diff options
| author | Chris Larson <chris_larson@mentor.com> | 2010-03-24 16:56:12 -0700 |
|---|---|---|
| committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-07-02 15:41:32 +0100 |
| commit | 7acc132cac873e60005516272473a55a8160b9c4 (patch) | |
| tree | 2e4122862ffd856803160b6089fcb979d3efd630 /bitbake/lib/bb/persist_data.py | |
| parent | bbf83fd988ca3cf9dae7d2b542a11a7c942b1702 (diff) | |
| download | poky-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/persist_data.py')
| -rw-r--r-- | bitbake/lib/bb/persist_data.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/bitbake/lib/bb/persist_data.py b/bitbake/lib/bb/persist_data.py index bc4045fe85..e2bbbe54f7 100644 --- a/bitbake/lib/bb/persist_data.py +++ b/bitbake/lib/bb/persist_data.py | |||
| @@ -33,11 +33,11 @@ class PersistData: | |||
| 33 | """ | 33 | """ |
| 34 | BitBake Persistent Data Store | 34 | BitBake Persistent Data Store |
| 35 | 35 | ||
| 36 | Used to store data in a central location such that other threads/tasks can | 36 | Used to store data in a central location such that other threads/tasks can |
| 37 | access them at some future date. | 37 | access them at some future date. |
| 38 | 38 | ||
| 39 | The "domain" is used as a key to isolate each data pool and in this | 39 | The "domain" is used as a key to isolate each data pool and in this |
| 40 | implementation corresponds to an SQL table. The SQL table consists of a | 40 | implementation corresponds to an SQL table. The SQL table consists of a |
| 41 | simple key and value pair. | 41 | simple key and value pair. |
| 42 | 42 | ||
| 43 | Why sqlite? It handles all the locking issues for us. | 43 | Why sqlite? It handles all the locking issues for us. |
| @@ -78,7 +78,7 @@ class PersistData: | |||
| 78 | for row in data: | 78 | for row in data: |
| 79 | ret[str(row[0])] = str(row[1]) | 79 | ret[str(row[0])] = str(row[1]) |
| 80 | 80 | ||
| 81 | return ret | 81 | return ret |
| 82 | 82 | ||
| 83 | def getValue(self, domain, key): | 83 | def getValue(self, domain, key): |
| 84 | """ | 84 | """ |
| @@ -108,7 +108,7 @@ class PersistData: | |||
| 108 | self._execute("DELETE from %s where key=?;" % domain, [key]) | 108 | self._execute("DELETE from %s where key=?;" % domain, [key]) |
| 109 | 109 | ||
| 110 | def _execute(self, *query): | 110 | def _execute(self, *query): |
| 111 | while True: | 111 | while True: |
| 112 | try: | 112 | try: |
| 113 | self.connection.execute(*query) | 113 | self.connection.execute(*query) |
| 114 | return | 114 | return |
| @@ -116,6 +116,3 @@ class PersistData: | |||
| 116 | if 'database is locked' in str(e): | 116 | if 'database is locked' in str(e): |
| 117 | continue | 117 | continue |
| 118 | raise | 118 | raise |
| 119 | |||
| 120 | |||
| 121 | |||
