Merge lp:~robru/friends/csv-model-schema into lp:friends
- csv-model-schema
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Ken VanDine |
Approved revision: | 185 |
Merged at revision: | 181 |
Proposed branch: | lp:~robru/friends/csv-model-schema |
Merge into: | lp:friends |
Diff against target: |
383 lines (+113/-93) 10 files modified
data/model-schema.csv (+23/-0) debian/friends.install (+1/-0) friends/tests/mocks.py (+9/-2) friends/tests/test_protocols.py (+5/-5) friends/utils/base.py (+13/-13) friends/utils/model.py (+39/-44) service/src/service.vala (+14/-26) setup.py (+3/-1) tools/debug_live.py (+3/-0) tools/debug_slave.py (+3/-2) |
To merge this branch: | bzr merge lp:~robru/friends/csv-model-schema |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ken VanDine | Approve | ||
PS Jenkins bot (community) | continuous-integration | Approve | |
Review via email: mp+157246@code.launchpad.net |
Commit message
Unify model schema definition into a CSV.
Description of the change
The holy grail ;-)
Define the model schema in one unified location, and parse it in from both model.py and service.vala. This way schema changes are much less error-prone.
PS Jenkins bot (ps-jenkins) wrote : | # |
Ken VanDine (ken-vandine) wrote : | # |
You should try to read from the source tree before trying to read the installed file.
Ken VanDine (ken-vandine) wrote : | # |
Whoops, forgot to set it to needs fixing.
- 180. By Robert Bruce Park
-
Stop parsing CSV at import-time.
This commit makes it a lot easier to force the reading of the schema
from the source tree before installing Friends.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:180
http://
Executed test runs:
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 181. By Robert Bruce Park
-
Unify some import logic.
- 182. By Robert Bruce Park
-
Make a comment more explicit.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:181
http://
Executed test runs:
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:182
http://
Executed test runs:
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 183. By Robert Bruce Park
-
Regex is overkill.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:183
http://
Executed test runs:
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 184. By Robert Bruce Park
-
Rebase on trunk.
- 185. By Robert Bruce Park
-
Flush revision queue every 5 minutes.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:184
http://
Executed test runs:
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:185
http://
Executed test runs:
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === added file 'data/model-schema.csv' | |||
2 | --- data/model-schema.csv 1970-01-01 00:00:00 +0000 | |||
3 | +++ data/model-schema.csv 2013-04-05 18:49:21 +0000 | |||
4 | @@ -0,0 +1,23 @@ | |||
5 | 1 | protocol,s | ||
6 | 2 | account_id,t | ||
7 | 3 | message_id,s | ||
8 | 4 | stream,s | ||
9 | 5 | sender,s | ||
10 | 6 | sender_id,s | ||
11 | 7 | sender_nick,s | ||
12 | 8 | from_me,b | ||
13 | 9 | timestamp,s | ||
14 | 10 | message,s | ||
15 | 11 | icon_uri,s | ||
16 | 12 | url,s | ||
17 | 13 | likes,t | ||
18 | 14 | liked,b | ||
19 | 15 | link_picture,s | ||
20 | 16 | link_name,s | ||
21 | 17 | link_url,s | ||
22 | 18 | link_desc,s | ||
23 | 19 | link_caption,s | ||
24 | 20 | link_icon,s | ||
25 | 21 | location,s | ||
26 | 22 | latitude,d | ||
27 | 23 | longitude,d | ||
28 | 0 | 24 | ||
29 | === modified file 'debian/friends.install' | |||
30 | --- debian/friends.install 2013-02-07 22:05:09 +0000 | |||
31 | +++ debian/friends.install 2013-04-05 18:49:21 +0000 | |||
32 | @@ -1,3 +1,4 @@ | |||
33 | 1 | usr/bin/friends-service | 1 | usr/bin/friends-service |
34 | 2 | usr/share/dbus-1/services/com.canonical.Friends.Service.service | 2 | usr/share/dbus-1/services/com.canonical.Friends.Service.service |
35 | 3 | usr/share/friends/model-schema.csv | ||
36 | 3 | usr/share/glib-2.0/schemas/com.canonical.friends.gschema.xml | 4 | usr/share/glib-2.0/schemas/com.canonical.friends.gschema.xml |
37 | 4 | 5 | ||
38 | === modified file 'friends/tests/mocks.py' | |||
39 | --- friends/tests/mocks.py 2013-03-14 19:44:13 +0000 | |||
40 | +++ friends/tests/mocks.py 2013-04-05 18:49:21 +0000 | |||
41 | @@ -40,9 +40,16 @@ | |||
42 | 40 | from urllib.parse import urlsplit | 40 | from urllib.parse import urlsplit |
43 | 41 | from gi.repository import Dee | 41 | from gi.repository import Dee |
44 | 42 | 42 | ||
45 | 43 | # By default, Schema.FILES will look for the system-installed schema | ||
46 | 44 | # file first, and then failing that will look for the one in the | ||
47 | 45 | # source tree, for performance reasons. During testing though, we want | ||
48 | 46 | # to look at the source tree first, so we reverse the list here. | ||
49 | 47 | from friends.utils.model import Schema | ||
50 | 48 | Schema.FILES = list(reversed(Schema.FILES)) | ||
51 | 49 | SCHEMA = Schema() | ||
52 | 50 | |||
53 | 43 | from friends.utils.base import Base | 51 | from friends.utils.base import Base |
54 | 44 | from friends.utils.logging import LOG_FORMAT | 52 | from friends.utils.logging import LOG_FORMAT |
55 | 45 | from friends.utils.model import COLUMN_TYPES | ||
56 | 46 | 53 | ||
57 | 47 | 54 | ||
58 | 48 | try: | 55 | try: |
59 | @@ -58,7 +65,7 @@ | |||
60 | 58 | # Create a test model that will not interfere with the user's environment. | 65 | # Create a test model that will not interfere with the user's environment. |
61 | 59 | # We'll use this object as a mock of the real model. | 66 | # We'll use this object as a mock of the real model. |
62 | 60 | TestModel = Dee.SharedModel.new('com.canonical.Friends.TestSharedModel') | 67 | TestModel = Dee.SharedModel.new('com.canonical.Friends.TestSharedModel') |
64 | 61 | TestModel.set_schema_full(COLUMN_TYPES) | 68 | TestModel.set_schema_full(SCHEMA.TYPES) |
65 | 62 | 69 | ||
66 | 63 | 70 | ||
67 | 64 | @mock.patch('friends.utils.http._soup', mock.Mock()) | 71 | @mock.patch('friends.utils.http._soup', mock.Mock()) |
68 | 65 | 72 | ||
69 | === modified file 'friends/tests/test_protocols.py' | |||
70 | --- friends/tests/test_protocols.py 2013-04-04 19:44:01 +0000 | |||
71 | +++ friends/tests/test_protocols.py 2013-04-05 18:49:21 +0000 | |||
72 | @@ -26,10 +26,10 @@ | |||
73 | 26 | 26 | ||
74 | 27 | from friends.protocols.flickr import Flickr | 27 | from friends.protocols.flickr import Flickr |
75 | 28 | from friends.protocols.twitter import Twitter | 28 | from friends.protocols.twitter import Twitter |
77 | 29 | from friends.tests.mocks import FakeAccount, LogMock, TestModel, mock | 29 | from friends.tests.mocks import SCHEMA, FakeAccount, LogMock, TestModel, mock |
78 | 30 | from friends.utils.base import Base, feature, linkify_string | 30 | from friends.utils.base import Base, feature, linkify_string |
79 | 31 | from friends.utils.manager import ProtocolManager | 31 | from friends.utils.manager import ProtocolManager |
81 | 32 | from friends.utils.model import COLUMN_INDICES, Model | 32 | from friends.utils.model import Model |
82 | 33 | 33 | ||
83 | 34 | 34 | ||
84 | 35 | class TestProtocolManager(unittest.TestCase): | 35 | class TestProtocolManager(unittest.TestCase): |
85 | @@ -282,7 +282,7 @@ | |||
86 | 282 | self.assertEqual(1, TestModel.get_n_rows()) | 282 | self.assertEqual(1, TestModel.get_n_rows()) |
87 | 283 | # The first published message wins. | 283 | # The first published message wins. |
88 | 284 | row = TestModel.get_row(0) | 284 | row = TestModel.get_row(0) |
90 | 285 | self.assertEqual(row[COLUMN_INDICES['message']], 'hello, @jimmy') | 285 | self.assertEqual(row[SCHEMA.INDICES['message']], 'hello, @jimmy') |
91 | 286 | 286 | ||
92 | 287 | @mock.patch('friends.utils.base.Model', TestModel) | 287 | @mock.patch('friends.utils.base.Model', TestModel) |
93 | 288 | @mock.patch('friends.utils.base._seen_ids', {}) | 288 | @mock.patch('friends.utils.base._seen_ids', {}) |
94 | @@ -364,10 +364,10 @@ | |||
95 | 364 | # See? Two rows in the table. | 364 | # See? Two rows in the table. |
96 | 365 | self.assertEqual(2, TestModel.get_n_rows()) | 365 | self.assertEqual(2, TestModel.get_n_rows()) |
97 | 366 | # The first row is the message from fred. | 366 | # The first row is the message from fred. |
99 | 367 | self.assertEqual(TestModel.get_row(0)[COLUMN_INDICES['sender']], | 367 | self.assertEqual(TestModel.get_row(0)[SCHEMA.INDICES['sender']], |
100 | 368 | 'fred') | 368 | 'fred') |
101 | 369 | # The second row is the message from tedtholomew. | 369 | # The second row is the message from tedtholomew. |
103 | 370 | self.assertEqual(TestModel.get_row(1)[COLUMN_INDICES['sender']], | 370 | self.assertEqual(TestModel.get_row(1)[SCHEMA.INDICES['sender']], |
104 | 371 | 'tedtholomew') | 371 | 'tedtholomew') |
105 | 372 | 372 | ||
106 | 373 | @mock.patch('friends.utils.base.Model', TestModel) | 373 | @mock.patch('friends.utils.base.Model', TestModel) |
107 | 374 | 374 | ||
108 | === modified file 'friends/utils/base.py' | |||
109 | --- friends/utils/base.py 2013-04-04 22:33:23 +0000 | |||
110 | +++ friends/utils/base.py 2013-04-05 18:49:21 +0000 | |||
111 | @@ -35,22 +35,22 @@ | |||
112 | 35 | 35 | ||
113 | 36 | from friends.errors import FriendsError, ContactsError | 36 | from friends.errors import FriendsError, ContactsError |
114 | 37 | from friends.utils.authentication import Authentication | 37 | from friends.utils.authentication import Authentication |
117 | 38 | from friends.utils.model import COLUMN_INDICES, SCHEMA, DEFAULTS | 38 | from friends.utils.model import Schema, Model, persist_model |
116 | 39 | from friends.utils.model import Model, persist_model | ||
118 | 40 | from friends.utils.notify import notify | 39 | from friends.utils.notify import notify |
119 | 41 | from friends.utils.time import ISO8601_FORMAT | 40 | from friends.utils.time import ISO8601_FORMAT |
120 | 42 | 41 | ||
121 | 43 | 42 | ||
122 | 44 | STUB = lambda *ignore, **kwignore: None | 43 | STUB = lambda *ignore, **kwignore: None |
123 | 45 | COMMA_SPACE = ', ' | 44 | COMMA_SPACE = ', ' |
132 | 46 | AVATAR_IDX = COLUMN_INDICES['icon_uri'] | 45 | SCHEMA = Schema() |
133 | 47 | FROM_ME_IDX = COLUMN_INDICES['from_me'] | 46 | AVATAR_IDX = SCHEMA.INDICES['icon_uri'] |
134 | 48 | STREAM_IDX = COLUMN_INDICES['stream'] | 47 | FROM_ME_IDX = SCHEMA.INDICES['from_me'] |
135 | 49 | SENDER_IDX = COLUMN_INDICES['sender'] | 48 | STREAM_IDX = SCHEMA.INDICES['stream'] |
136 | 50 | MESSAGE_IDX = COLUMN_INDICES['message'] | 49 | SENDER_IDX = SCHEMA.INDICES['sender'] |
137 | 51 | ID_IDX = COLUMN_INDICES['message_id'] | 50 | MESSAGE_IDX = SCHEMA.INDICES['message'] |
138 | 52 | ACCT_IDX = COLUMN_INDICES['account_id'] | 51 | ID_IDX = SCHEMA.INDICES['message_id'] |
139 | 53 | TIME_IDX = COLUMN_INDICES['timestamp'] | 52 | ACCT_IDX = SCHEMA.INDICES['account_id'] |
140 | 53 | TIME_IDX = SCHEMA.INDICES['timestamp'] | ||
141 | 54 | 54 | ||
142 | 55 | # See friends/tests/test_protocols.py for further documentation | 55 | # See friends/tests/test_protocols.py for further documentation |
143 | 56 | LINKIFY_REGEX = re.compile( | 56 | LINKIFY_REGEX = re.compile( |
144 | @@ -355,8 +355,8 @@ | |||
145 | 355 | # the order which they appear in the SCHEMA. If any are left | 355 | # the order which they appear in the SCHEMA. If any are left |
146 | 356 | # over at the end of this, raise a TypeError indicating the | 356 | # over at the end of this, raise a TypeError indicating the |
147 | 357 | # unexpected column names. | 357 | # unexpected column names. |
150 | 358 | for column_name, column_type in SCHEMA: | 358 | for column_name, column_type in SCHEMA.COLUMNS: |
151 | 359 | args.append(kwargs.pop(column_name, DEFAULTS[column_type])) | 359 | args.append(kwargs.pop(column_name, SCHEMA.DEFAULTS[column_type])) |
152 | 360 | if len(kwargs) > 0: | 360 | if len(kwargs) > 0: |
153 | 361 | raise TypeError('Unexpected keyword arguments: {}'.format( | 361 | raise TypeError('Unexpected keyword arguments: {}'.format( |
154 | 362 | COMMA_SPACE.join(sorted(kwargs)))) | 362 | COMMA_SPACE.join(sorted(kwargs)))) |
155 | @@ -506,7 +506,7 @@ | |||
156 | 506 | def _calculate_row_cell(self, message_id, column_name): | 506 | def _calculate_row_cell(self, message_id, column_name): |
157 | 507 | """Find x,y coords in the model based on message_id and column_name.""" | 507 | """Find x,y coords in the model based on message_id and column_name.""" |
158 | 508 | row_id = _seen_ids.get(message_id) | 508 | row_id = _seen_ids.get(message_id) |
160 | 509 | col_idx = COLUMN_INDICES.get(column_name) | 509 | col_idx = SCHEMA.INDICES.get(column_name) |
161 | 510 | if None in (row_id, col_idx): | 510 | if None in (row_id, col_idx): |
162 | 511 | raise FriendsError('Cell could not be found.') | 511 | raise FriendsError('Cell could not be found.') |
163 | 512 | return row_id, col_idx | 512 | return row_id, col_idx |
164 | 513 | 513 | ||
165 | === modified file 'friends/utils/model.py' | |||
166 | --- friends/utils/model.py 2013-03-13 04:36:33 +0000 | |||
167 | +++ friends/utils/model.py 2013-04-05 18:49:21 +0000 | |||
168 | @@ -24,11 +24,8 @@ | |||
169 | 24 | 24 | ||
170 | 25 | 25 | ||
171 | 26 | __all__ = [ | 26 | __all__ = [ |
172 | 27 | 'Schema', | ||
173 | 27 | 'Model', | 28 | 'Model', |
174 | 28 | 'COLUMN_NAMES', | ||
175 | 29 | 'COLUMN_TYPES', | ||
176 | 30 | 'COLUMN_INDICES', | ||
177 | 31 | 'DEFAULTS', | ||
178 | 32 | 'MODEL_DBUS_NAME', | 29 | 'MODEL_DBUS_NAME', |
179 | 33 | 'persist_model', | 30 | 'persist_model', |
180 | 34 | 'prune_model', | 31 | 'prune_model', |
181 | @@ -41,46 +38,44 @@ | |||
182 | 41 | log = logging.getLogger(__name__) | 38 | log = logging.getLogger(__name__) |
183 | 42 | 39 | ||
184 | 43 | 40 | ||
225 | 44 | # DO NOT EDIT THIS WITHOUT ADJUSTING service.vala IN LOCKSTEP | 41 | class Schema: |
226 | 45 | SCHEMA = ( | 42 | """Represents the DeeModel schema data that we defined in CSV.""" |
227 | 46 | ('protocol', 's'), # Same as UOA 'provider_name' | 43 | DEFAULTS = { |
228 | 47 | ('account_id', 't'), # Same as UOA account id | 44 | 'b': False, |
229 | 48 | ('message_id', 's'), | 45 | 's': '', |
230 | 49 | ('stream', 's'), | 46 | 'd': 0, |
231 | 50 | ('sender', 's'), | 47 | 't': 0, |
232 | 51 | ('sender_id', 's'), | 48 | } |
233 | 52 | ('sender_nick', 's'), | 49 | |
234 | 53 | ('from_me', 'b'), | 50 | FILES = [ |
235 | 54 | ('timestamp', 's'), | 51 | 'data/model-schema.csv', |
236 | 55 | ('message', 's'), | 52 | '/usr/share/friends/model-schema.csv', |
237 | 56 | ('icon_uri', 's'), | 53 | ] |
238 | 57 | ('url', 's'), | 54 | |
239 | 58 | ('likes', 't'), | 55 | def __init__(self): |
240 | 59 | ('liked', 'b'), | 56 | """Parse CSV from disk.""" |
241 | 60 | ('link_picture', 's'), | 57 | self.COLUMNS = [] |
242 | 61 | ('link_name', 's'), | 58 | self.NAMES = [] |
243 | 62 | ('link_url', 's'), | 59 | self.TYPES = [] |
244 | 63 | ('link_desc', 's'), | 60 | self.INDICES = {} |
245 | 64 | ('link_caption', 's'), | 61 | |
246 | 65 | ('link_icon', 's'), | 62 | files = self.FILES.copy() |
247 | 66 | ('location', 's'), | 63 | while files: |
248 | 67 | ('latitude', 'd'), | 64 | filename = files.pop() |
249 | 68 | ('longitude', 'd'), | 65 | log.debug('Looking for SCHEMA in {}'.format(filename)) |
250 | 69 | ) | 66 | try: |
251 | 70 | 67 | with open(filename) as schema: | |
252 | 71 | 68 | for col in schema: | |
253 | 72 | # It's useful to have separate lists of the column names and types. | 69 | name, variant = col.rstrip().split(',') |
254 | 73 | COLUMN_NAMES, COLUMN_TYPES = zip(*SCHEMA) | 70 | self.COLUMNS.append((name, variant)) |
255 | 74 | # A reverse mapping from column name to the column index. This is useful for | 71 | self.NAMES.append(name) |
256 | 75 | # pulling column values out of a row of data. | 72 | self.TYPES.append(variant) |
257 | 76 | COLUMN_INDICES = {name: i for i, name in enumerate(COLUMN_NAMES)} | 73 | log.debug( |
258 | 77 | # This defines default values for the different data types | 74 | 'Found {} columns for SCHEMA'.format(len(self.COLUMNS))) |
259 | 78 | DEFAULTS = { | 75 | break |
260 | 79 | 'b': False, | 76 | except IOError: |
261 | 80 | 's': '', | 77 | pass |
262 | 81 | 'd': 0, | 78 | self.INDICES = {name: i for i, name in enumerate(self.NAMES)} |
223 | 82 | 't': 0, | ||
224 | 83 | } | ||
263 | 84 | 79 | ||
264 | 85 | 80 | ||
265 | 86 | MODEL_DBUS_NAME = 'com.canonical.Friends.Streams' | 81 | MODEL_DBUS_NAME = 'com.canonical.Friends.Streams' |
266 | 87 | 82 | ||
267 | === modified file 'service/src/service.vala' | |||
268 | --- service/src/service.vala 2013-03-13 04:36:33 +0000 | |||
269 | +++ service/src/service.vala 2013-04-05 18:49:21 +0000 | |||
270 | @@ -74,29 +74,17 @@ | |||
271 | 74 | debug ("Failed to load model from resource manager: %s", e.message); | 74 | debug ("Failed to load model from resource manager: %s", e.message); |
272 | 75 | } | 75 | } |
273 | 76 | 76 | ||
297 | 77 | string[] SCHEMA = {"s", | 77 | string[] SCHEMA = {}; |
298 | 78 | "t", | 78 | |
299 | 79 | "s", | 79 | var file = FileStream.open("/usr/share/friends/model-schema.csv", "r"); |
300 | 80 | "s", | 80 | string line = null; |
301 | 81 | "s", | 81 | while (true) |
302 | 82 | "s", | 82 | { |
303 | 83 | "s", | 83 | line = file.read_line(); |
304 | 84 | "b", | 84 | if (line == null) break; |
305 | 85 | "s", | 85 | SCHEMA += line.split(",")[1]; |
306 | 86 | "s", | 86 | } |
307 | 87 | "s", | 87 | debug ("Found %u schema columns.", SCHEMA.length); |
285 | 88 | "s", | ||
286 | 89 | "t", | ||
287 | 90 | "b", | ||
288 | 91 | "s", | ||
289 | 92 | "s", | ||
290 | 93 | "s", | ||
291 | 94 | "s", | ||
292 | 95 | "s", | ||
293 | 96 | "s", | ||
294 | 97 | "s", | ||
295 | 98 | "d", | ||
296 | 99 | "d"}; | ||
308 | 100 | 88 | ||
309 | 101 | bool schemaReset = false; | 89 | bool schemaReset = false; |
310 | 102 | 90 | ||
311 | @@ -109,7 +97,7 @@ | |||
312 | 109 | schemaReset = true; | 97 | schemaReset = true; |
313 | 110 | else | 98 | else |
314 | 111 | { | 99 | { |
316 | 112 | for (int i=0; i < _SCHEMA.length;i++ ) | 100 | for (int i=0; i < _SCHEMA.length; i++) |
317 | 113 | { | 101 | { |
318 | 114 | if (_SCHEMA[i] != SCHEMA[i]) | 102 | if (_SCHEMA[i] != SCHEMA[i]) |
319 | 115 | { | 103 | { |
320 | @@ -165,11 +153,11 @@ | |||
321 | 165 | debug ("NOT LEADER"); | 153 | debug ("NOT LEADER"); |
322 | 166 | }); | 154 | }); |
323 | 167 | 155 | ||
325 | 168 | Timeout.add_seconds (30, () => { | 156 | Timeout.add_seconds (300, () => { |
326 | 169 | shared_model.flush_revision_queue(); | 157 | shared_model.flush_revision_queue(); |
327 | 170 | debug ("Storing model with %u rows", model.get_n_rows()); | 158 | debug ("Storing model with %u rows", model.get_n_rows()); |
328 | 171 | resources.store ((Dee.SequenceModel)model, "com.canonical.Friends.Streams"); | 159 | resources.store ((Dee.SequenceModel)model, "com.canonical.Friends.Streams"); |
330 | 172 | return false; | 160 | return true; |
331 | 173 | }); | 161 | }); |
332 | 174 | } | 162 | } |
333 | 175 | 163 | ||
334 | 176 | 164 | ||
335 | === modified file 'setup.py' | |||
336 | --- setup.py 2013-03-14 20:25:42 +0000 | |||
337 | +++ setup.py 2013-04-05 18:49:21 +0000 | |||
338 | @@ -33,7 +33,9 @@ | |||
339 | 33 | }, | 33 | }, |
340 | 34 | data_files = [ | 34 | data_files = [ |
341 | 35 | ('/usr/share/glib-2.0/schemas', | 35 | ('/usr/share/glib-2.0/schemas', |
343 | 36 | ['data/com.canonical.friends.gschema.xml']) | 36 | ['data/com.canonical.friends.gschema.xml']), |
344 | 37 | ('/usr/share/friends', | ||
345 | 38 | ['data/model-schema.csv']), | ||
346 | 37 | ], | 39 | ], |
347 | 38 | entry_points = { | 40 | entry_points = { |
348 | 39 | 'console_scripts': ['friends-dispatcher = friends.main:main'], | 41 | 'console_scripts': ['friends-dispatcher = friends.main:main'], |
349 | 40 | 42 | ||
350 | === modified file 'tools/debug_live.py' | |||
351 | --- tools/debug_live.py 2013-03-13 18:05:13 +0000 | |||
352 | +++ tools/debug_live.py 2013-04-05 18:49:21 +0000 | |||
353 | @@ -24,6 +24,9 @@ | |||
354 | 24 | 24 | ||
355 | 25 | sys.path.insert(0, '.') | 25 | sys.path.insert(0, '.') |
356 | 26 | 26 | ||
357 | 27 | # Ignore system-installed schema. | ||
358 | 28 | from friends.tests.mocks import SCHEMA | ||
359 | 29 | |||
360 | 27 | from gi.repository import GLib | 30 | from gi.repository import GLib |
361 | 28 | from friends.utils.logging import initialize | 31 | from friends.utils.logging import initialize |
362 | 29 | 32 | ||
363 | 30 | 33 | ||
364 | === modified file 'tools/debug_slave.py' | |||
365 | --- tools/debug_slave.py 2013-04-04 22:33:06 +0000 | |||
366 | +++ tools/debug_slave.py 2013-04-05 18:49:21 +0000 | |||
367 | @@ -11,7 +11,8 @@ | |||
368 | 11 | from gi.repository import Dee | 11 | from gi.repository import Dee |
369 | 12 | from gi.repository import GLib | 12 | from gi.repository import GLib |
370 | 13 | 13 | ||
372 | 14 | from friends.utils.model import COLUMN_NAMES | 14 | from friends.tests.mocks import SCHEMA |
373 | 15 | |||
374 | 15 | 16 | ||
375 | 16 | class Slave: | 17 | class Slave: |
376 | 17 | def __init__(self): | 18 | def __init__(self): |
377 | @@ -25,7 +26,7 @@ | |||
378 | 25 | row = self.model.get_row(itr) | 26 | row = self.model.get_row(itr) |
379 | 26 | print('\n' * 5) | 27 | print('\n' * 5) |
380 | 27 | for i, col in enumerate(row): | 28 | for i, col in enumerate(row): |
382 | 28 | print('{:12}: {}'.format(COLUMN_NAMES[i], col)) | 29 | print('{:12}: {}'.format(SCHEMA.NAMES[i], col)) |
383 | 29 | print('ROWS: ', len(self.model)) | 30 | print('ROWS: ', len(self.model)) |
384 | 30 | 31 | ||
385 | 31 | 32 |
PASSED: Continuous integration, rev:179 jenkins. qa.ubuntu. com/job/ friends- ci/19/ jenkins. qa.ubuntu. com/job/ friends- raring- amd64-ci/ 19
http://
Executed test runs:
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins: 8080/job/ friends- ci/19/rebuild
http://