diff options
author | Tomeu Vizoso <tomeu@sugarlabs.org> | 2009-08-19 08:06:31 (GMT) |
---|---|---|
committer | Tomeu Vizoso <tomeu@sugarlabs.org> | 2009-08-19 08:06:31 (GMT) |
commit | d57bb1b20aa123821d1008432620fb316645e34b (patch) | |
tree | a1a93f991bbd3ca84be89006b9a427768574d7bf /src/jarabe/frame | |
parent | 48fce2af17dedbb28213a1e3f935615b1d67d500 (diff) |
Bunch of pylint fixes
Diffstat (limited to 'src/jarabe/frame')
-rw-r--r-- | src/jarabe/frame/clipboard.py | 18 | ||||
-rw-r--r-- | src/jarabe/frame/clipboardmenu.py | 12 | ||||
-rw-r--r-- | src/jarabe/frame/clipboardobject.py | 20 | ||||
-rw-r--r-- | src/jarabe/frame/clipboardtray.py | 4 |
4 files changed, 27 insertions, 27 deletions
diff --git a/src/jarabe/frame/clipboard.py b/src/jarabe/frame/clipboard.py index 0e3e125..d18dd44 100644 --- a/src/jarabe/frame/clipboard.py +++ b/src/jarabe/frame/clipboard.py @@ -59,9 +59,9 @@ class Clipboard(gobject.GObject): cb_object = self._objects[object_id] if format_type == 'XdndDirectSave0': - format = Format('text/uri-list', data + '\r\n', on_disk) - format.owns_disk_data = True - cb_object.add_format(format) + format_ = Format('text/uri-list', data + '\r\n', on_disk) + format_.owns_disk_data = True + cb_object.add_format(format_) elif on_disk and cb_object.get_percent() == 100: new_uri = self._copy_file(data) cb_object.add_format(Format(format_type, new_uri, on_disk)) @@ -98,10 +98,10 @@ class Clipboard(gobject.GObject): def _process_object(self, cb_object): formats = cb_object.get_formats() - for format_name, format in formats.iteritems(): - if format.is_on_disk() and not format.owns_disk_data: - new_uri = self._copy_file(format.get_data()) - format.set_data(new_uri) + for format_name, format_ in formats.iteritems(): + if format_.is_on_disk() and not format_.owns_disk_data: + new_uri = self._copy_file(format_.get_data()) + format_.set_data(new_uri) # Add a text/plain format to objects that are text but lack it if 'text/plain' not in formats.keys(): @@ -121,8 +121,8 @@ class Clipboard(gobject.GObject): def get_object_data(self, object_id, format_type): logging.debug('Clipboard.get_object_data') cb_object = self._objects[object_id] - format = cb_object.get_formats()[format_type] - return format + format_ = cb_object.get_formats()[format_type] + return format_ def _copy_file(self, original_uri): uri = urlparse.urlparse(original_uri) diff --git a/src/jarabe/frame/clipboardmenu.py b/src/jarabe/frame/clipboardmenu.py index d1d4105..8a8ba11 100644 --- a/src/jarabe/frame/clipboardmenu.py +++ b/src/jarabe/frame/clipboardmenu.py @@ -204,26 +204,26 @@ class ClipboardMenu(Palette): def _copy_to_journal(self): formats = self._cb_object.get_formats().keys() most_significant_mime_type = mime.choose_most_significant(formats) - format = self._cb_object.get_formats()[most_significant_mime_type] + format_ = self._cb_object.get_formats()[most_significant_mime_type] transfer_ownership = False if most_significant_mime_type == 'text/uri-list': - uris = mime.split_uri_list(format.get_data()) + uris = mime.split_uri_list(format_.get_data()) if len(uris) == 1 and uris[0].startswith('file://'): file_path = urlparse.urlparse(uris[0]).path transfer_ownership = False mime_type = mime.get_for_file(file_path) else: - file_path = self._write_to_temp_file(format.get_data()) + file_path = self._write_to_temp_file(format_.get_data()) transfer_ownership = True mime_type = 'text/uri-list' else: - if format.is_on_disk(): - file_path = urlparse.urlparse(format.get_data()).path + if format_.is_on_disk(): + file_path = urlparse.urlparse(format_.get_data()).path transfer_ownership = False mime_type = mime.get_for_file(file_path) else: - file_path = self._write_to_temp_file(format.get_data()) + file_path = self._write_to_temp_file(format_.get_data()) transfer_ownership = True sniffed_mime_type = mime.get_for_file(file_path) if sniffed_mime_type == 'application/octet-stream': diff --git a/src/jarabe/frame/clipboardobject.py b/src/jarabe/frame/clipboardobject.py index 38da151..91fa1e6 100644 --- a/src/jarabe/frame/clipboardobject.py +++ b/src/jarabe/frame/clipboardobject.py @@ -33,8 +33,8 @@ class ClipboardObject(object): self._formats = {} def destroy(self): - for format in self._formats.itervalues(): - format.destroy() + for format_ in self._formats.itervalues(): + format_.destroy() def get_id(self): return self._id @@ -91,8 +91,8 @@ class ClipboardObject(object): def set_percent(self, percent): self._percent = percent - def add_format(self, format): - self._formats[format.get_type()] = format + def add_format(self, format_): + self._formats[format_.get_type()] = format_ def get_formats(self): return self._formats @@ -101,18 +101,18 @@ class ClipboardObject(object): if not self._formats: return '' - format = mime.choose_most_significant(self._formats.keys()) - if format == 'text/uri-list': + format_ = mime.choose_most_significant(self._formats.keys()) + if format_ == 'text/uri-list': data = self._formats['text/uri-list'].get_data() uri = urlparse.urlparse(mime.split_uri_list(data)[0], 'file') if uri.scheme == 'file': if os.path.exists(uri.path): - format = mime.get_for_file(uri.path) + format_ = mime.get_for_file(uri.path) else: - format = mime.get_from_file_name(uri.path) - logging.debug('Choosed %r!' % format) + format_ = mime.get_from_file_name(uri.path) + logging.debug('Choosed %r!' % format_) - return format + return format_ class Format(object): diff --git a/src/jarabe/frame/clipboardtray.py b/src/jarabe/frame/clipboardtray.py index 40f0a32..a387328 100644 --- a/src/jarabe/frame/clipboardtray.py +++ b/src/jarabe/frame/clipboardtray.py @@ -153,7 +153,7 @@ class ClipboardTray(tray.VTray): if 'XdndDirectSave0' in context.targets: window = context.source_window - prop_type, format, filename = \ + prop_type, format_, filename = \ window.property_get('XdndDirectSave0','text/plain') # FIXME query the clipboard service for a filename? @@ -165,7 +165,7 @@ class ClipboardTray(tray.VTray): dest_uri = 'file://' + os.path.join(base_dir, dest_filename) - window.property_change('XdndDirectSave0', prop_type, format, + window.property_change('XdndDirectSave0', prop_type, format_, gtk.gdk.PROP_MODE_REPLACE, dest_uri) widget.drag_get_data(context, 'XdndDirectSave0', time) |