src/eric7/Plugins/WizardPlugins/SetupWizard/SetupCfgUtilities.py

branch
eric7
changeset 9221
bf71ee032bb4
parent 9209
b99e7fd55fd3
child 9653
e67609152c5e
equal deleted inserted replaced
9220:e9e7eca7efee 9221:bf71ee032bb4
19 19
20 20
21 def _bool2string(value): 21 def _bool2string(value):
22 """ 22 """
23 Function to convert a bool value to a setup.cfg string. 23 Function to convert a bool value to a setup.cfg string.
24 24
25 @param value bool value to be converted 25 @param value bool value to be converted
26 @type bool 26 @type bool
27 @return setup.cfg string 27 @return setup.cfg string
28 @rtype str 28 @rtype str
29 """ 29 """
31 31
32 32
33 def _list2string(value): 33 def _list2string(value):
34 """ 34 """
35 Function to convert a list value to a setup.cfg string. 35 Function to convert a list value to a setup.cfg string.
36 36
37 @param value list value to be converted 37 @param value list value to be converted
38 @type list 38 @type list
39 @return setup.cfg string 39 @return setup.cfg string
40 @rtype str 40 @rtype str
41 """ 41 """
42 if value: 42 if value:
43 return "\n{0}".format("\n".join(sorted(filter(None, value)))) 43 return "\n{0}".format("\n".join(sorted(filter(None, value))))
44 44
45 return "" 45 return ""
46 46
47 47
48 def _dict2list(value): 48 def _dict2list(value):
49 """ 49 """
50 Function to convert a dict value to a setup.cfg list string. 50 Function to convert a dict value to a setup.cfg list string.
51 51
52 @param value dict value to be converted 52 @param value dict value to be converted
53 @type dict 53 @type dict
54 @yield setup.cfg string 54 @yield setup.cfg string
55 @ytype str 55 @ytype str
56 """ 56 """
59 59
60 60
61 def _dict2string(value): 61 def _dict2string(value):
62 """ 62 """
63 Function to convert a dict value to a setup.cfg string. 63 Function to convert a dict value to a setup.cfg string.
64 64
65 @param value dict value to be converted 65 @param value dict value to be converted
66 @type dict 66 @type dict
67 @return setup.cfg string 67 @return setup.cfg string
68 @rtype str 68 @rtype str
69 """ 69 """
71 71
72 72
73 def toString(value): 73 def toString(value):
74 """ 74 """
75 Function to convert a value to a setup.cfg string. 75 Function to convert a value to a setup.cfg string.
76 76
77 @param value value to be converted 77 @param value value to be converted
78 @type bool, list, set, tuple or dict 78 @type bool, list, set, tuple or dict
79 @return setup.cfg string 79 @return setup.cfg string
80 @rtype str 80 @rtype str
81 """ 81 """

eric ide

mercurial