summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/data.py
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-03-24 16:56:12 -0700
committerRichard Purdie <rpurdie@linux.intel.com>2010-07-02 15:41:32 +0100
commit7acc132cac873e60005516272473a55a8160b9c4 (patch)
tree2e4122862ffd856803160b6089fcb979d3efd630 /bitbake/lib/bb/data.py
parentbbf83fd988ca3cf9dae7d2b542a11a7c942b1702 (diff)
downloadpoky-7acc132cac873e60005516272473a55a8160b9c4.tar.gz
Formatting cleanups
(Bitbake rev: 2caf134b43a44dad30af4fbe33033b3c58deee57) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/data.py')
-rw-r--r--bitbake/lib/bb/data.py35
1 files changed, 17 insertions, 18 deletions
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py
index cc5594e41e..e71ad6b9c0 100644
--- a/bitbake/lib/bb/data.py
+++ b/bitbake/lib/bb/data.py
@@ -11,7 +11,7 @@ operations. At night the cookie monster came by and
11suggested 'give me cookies on setting the variables and 11suggested 'give me cookies on setting the variables and
12things will work out'. Taking this suggestion into account 12things will work out'. Taking this suggestion into account
13applying the skills from the not yet passed 'Entwurf und 13applying the skills from the not yet passed 'Entwurf und
14Analyse von Algorithmen' lecture and the cookie 14Analyse von Algorithmen' lecture and the cookie
15monster seems to be right. We will track setVar more carefully 15monster seems to be right. We will track setVar more carefully
16to have faster update_data and expandKeys operations. 16to have faster update_data and expandKeys operations.
17 17
@@ -42,7 +42,7 @@ if sys.argv[0][-5:] == "pydoc":
42 path = os.path.dirname(os.path.dirname(sys.argv[1])) 42 path = os.path.dirname(os.path.dirname(sys.argv[1]))
43else: 43else:
44 path = os.path.dirname(os.path.dirname(sys.argv[0])) 44 path = os.path.dirname(os.path.dirname(sys.argv[0]))
45sys.path.insert(0,path) 45sys.path.insert(0, path)
46 46
47from bb import data_smart 47from bb import data_smart
48import bb 48import bb
@@ -62,14 +62,14 @@ def init_db(parent = None):
62 return _dict_type() 62 return _dict_type()
63 63
64def createCopy(source): 64def createCopy(source):
65 """Link the source set to the destination 65 """Link the source set to the destination
66 If one does not find the value in the destination set, 66 If one does not find the value in the destination set,
67 search will go on to the source set to get the value. 67 search will go on to the source set to get the value.
68 Value from source are copy-on-write. i.e. any try to 68 Value from source are copy-on-write. i.e. any try to
69 modify one of them will end up putting the modified value 69 modify one of them will end up putting the modified value
70 in the destination set. 70 in the destination set.
71 """ 71 """
72 return source.createCopy() 72 return source.createCopy()
73 73
74def initVar(var, d): 74def initVar(var, d):
75 """Non-destructive var init for data structure""" 75 """Non-destructive var init for data structure"""
@@ -78,12 +78,12 @@ def initVar(var, d):
78 78
79def setVar(var, value, d): 79def setVar(var, value, d):
80 """Set a variable to a given value""" 80 """Set a variable to a given value"""
81 d.setVar(var,value) 81 d.setVar(var, value)
82 82
83 83
84def getVar(var, d, exp = 0): 84def getVar(var, d, exp = 0):
85 """Gets the value of a variable""" 85 """Gets the value of a variable"""
86 return d.getVar(var,exp) 86 return d.getVar(var, exp)
87 87
88 88
89def renameVar(key, newkey, d): 89def renameVar(key, newkey, d):
@@ -96,15 +96,15 @@ def delVar(var, d):
96 96
97def setVarFlag(var, flag, flagvalue, d): 97def setVarFlag(var, flag, flagvalue, d):
98 """Set a flag for a given variable to a given value""" 98 """Set a flag for a given variable to a given value"""
99 d.setVarFlag(var,flag,flagvalue) 99 d.setVarFlag(var, flag, flagvalue)
100 100
101def getVarFlag(var, flag, d): 101def getVarFlag(var, flag, d):
102 """Gets given flag from given var""" 102 """Gets given flag from given var"""
103 return d.getVarFlag(var,flag) 103 return d.getVarFlag(var, flag)
104 104
105def delVarFlag(var, flag, d): 105def delVarFlag(var, flag, d):
106 """Removes a given flag from the variable's flags""" 106 """Removes a given flag from the variable's flags"""
107 d.delVarFlag(var,flag) 107 d.delVarFlag(var, flag)
108 108
109def setVarFlags(var, flags, d): 109def setVarFlags(var, flags, d):
110 """Set the flags for a given variable 110 """Set the flags for a given variable
@@ -114,7 +114,7 @@ def setVarFlags(var, flags, d):
114 flags. Think of this method as 114 flags. Think of this method as
115 addVarFlags 115 addVarFlags
116 """ 116 """
117 d.setVarFlags(var,flags) 117 d.setVarFlags(var, flags)
118 118
119def getVarFlags(var, d): 119def getVarFlags(var, d):
120 """Gets a variable's flags""" 120 """Gets a variable's flags"""
@@ -178,7 +178,7 @@ def expandKeys(alterdata, readdata = None):
178 continue 178 continue
179 todolist[key] = ekey 179 todolist[key] = ekey
180 180
181 # These two for loops are split for performance to maximise the 181 # These two for loops are split for performance to maximise the
182 # usefulness of the expand cache 182 # usefulness of the expand cache
183 183
184 for key in todolist: 184 for key in todolist:
@@ -267,7 +267,6 @@ def emit_var(var, o=sys.__stdout__, d = init(), all=False):
267 o.write('%s="%s"\n' % (varExpanded, alter)) 267 o.write('%s="%s"\n' % (varExpanded, alter))
268 return 1 268 return 1
269 269
270
271def emit_env(o=sys.__stdout__, d = init(), all=False): 270def emit_env(o=sys.__stdout__, d = init(), all=False):
272 """Emits all items in the data store in a format such that it can be sourced by a shell.""" 271 """Emits all items in the data store in a format such that it can be sourced by a shell."""
273 272