blob: f2e51b1ae99437d3b486b51f06c5683e06f69d3a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
# Copyright 2017 Canonical Ltd.
# Licensed under the LGPLv3, see LICENCE file for details.
def condition_with_prefix(prefix, condition):
'''Returns the given string prefixed by the given prefix.
If the prefix is non-empty, a colon is used to separate them.
'''
if prefix == '':
return condition
return prefix + ':' + condition
|