Changeset 1145:4904633ee0ec
- Timestamp:
- 04/29/08 12:02:04 (2 months ago)
- Author:
- Ronny Pfannschmidt <Ronny.Pfannschmidt@…>
- Message:
-
some code cleanups
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r884
|
r1145
|
|
| 162 | 162 | |
| 163 | 163 | # don't make empty search |
| 164 | | if len(pattern) <= 0: |
| | 164 | if not pattern: |
| 165 | 165 | return |
| 166 | 166 | |
-
|
r412
|
r1145
|
|
| 177 | 177 | return len(self._options) |
| 178 | 178 | |
| 179 | | def iter_options(self): |
| 180 | | return self._options.values() |
| | 179 | def __iter__(self): |
| | 180 | return self._options.itervalues() |
| | 181 | |
| | 182 | def __nonzero__(self): |
| | 183 | return bool(self._options) |
| 181 | 184 | |
| 182 | | |
-
|
r1142
|
r1145
|
|
| 102 | 102 | default = self.get_default_controller() |
| 103 | 103 | if default is None: |
| 104 | | if len(self.controllers): |
| | 104 | if self.controllers: |
| 105 | 105 | self.controllers[0].default = True |
| 106 | 106 | self.save() |
-
|
r1144
|
r1145
|
|
| 74 | 74 | self._services = [] |
| 75 | 75 | for svc in self.svc.boss.get_services(): |
| 76 | | if len(svc.options): |
| | 76 | if svc.options: |
| 77 | 77 | self._services.append(svc) |
| 78 | 78 | self._services_display.append( |
| … |
… |
|
| 109 | 109 | labelsizer = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL) |
| 110 | 110 | widgetsizer = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL) |
| 111 | | options = list(svc.options.iter_options()) |
| 112 | | options.sort() |
| 113 | | for opt in options: |
| | 111 | |
| | 112 | for opt in sorted(svc.options): |
| 114 | 113 | vb = gtk.VBox(spacing=2) |
| 115 | 114 | vb.set_border_width(6) |
| … |
… |
|
| 192 | 191 | |
| 193 | 192 | def plugin_changed(self, plugin): |
| 194 | | if len(plugin.options): |
| | 193 | if plugin.options: |
| 195 | 194 | self.svc.refresh_view() |
| 196 | 195 | |
-
|
r1141
|
r1145
|
|
| 304 | 304 | load each file in self.buffers into the buffer manager |
| 305 | 305 | """ |
| 306 | | if len(files): |
| | 306 | if files: |
| 307 | 307 | self.boss.cmd('buffer', 'open_file', file_name=files.pop()) |
| 308 | 308 | else: |
-
|
r108
|
r1145
|
|
| 10 | 10 | |
| 11 | 11 | class BaseConfigTest(TestCase): |
| 12 | | |
| 13 | | def setUp(self): |
| 14 | | self._svc = Mock({'get_name': 'banana'}) |
| 15 | | self._conf = TestConfig(self._svc) |
| 16 | | |
| 17 | | def test_get_name(self): |
| 18 | | self.assertEqual(self._conf.get_service_name(), 'banana') |
| 19 | | |
| | 12 | pass |