def thread_do(self): gd_client = picasa_login() if not gd_client: return progress_dialog = ProgressDialogController( _("Uploading Pictures"), _("Uploading pictures to Picasa Web Album"), max_value=self._files_albums_count ) progress_dialog.show() try: upass = __kupfer_settings__["userpass"] progress = 0 for files, album_id, album_name in self._files_to_upload: # create album if album_id is None: progress_dialog.update(progress, _("Creating album:"), album_name) album = gd_client.InsertAlbum(title=album_name, summary=_("Album created by Kupfer")) album_id = album.gphoto_id.text progress += 1 # send files album_url = ALBUM_URL % (upass.username, album_id) for filename in files: pretty.print_debug(__name__, "upload: sending", filename) progress_dialog.update(progress, _("File:"), utils.get_display_path_for_bytestring(filename)) if progress_dialog.aborted: pretty.print_debug(__name__, "upload: abort") break # send file gd_client.InsertPhotoSimple(album_url, os.path.basename(filename), "", filename) pretty.print_debug(__name__, "upload: file sended", filename) progress += 1 except (gdata.service.Error, gdata.photos.service.GooglePhotosException), err: pretty.print_error(__name__, "upload error", err)
def get_description(self): # Use Application's description, else use executable # for "file-based" applications we show the path app_desc = tounicode(self.object.get_description()) ret = tounicode(app_desc if app_desc else self.object.get_executable()) if self.init_path: app_path = utils.get_display_path_for_bytestring(self.init_path) return u"(%s) %s" % (app_path, ret) return ret
def get_description(self): # Use Application's description, else use executable # for "file-based" applications we show the path app_desc = tounicode(self.object.get_description()) ret = tounicode(app_desc if app_desc else self.object.get_executable()) if self.init_path: app_path = utils.get_display_path_for_bytestring(self.init_path) return u"(%s) %s" % (app_path, ret) return ret
def add_directory_model(self, d, store=False): have = list(os.path.normpath(row[0]) for row in self.dir_store) if d in have: self.output_debug("Ignoring duplicate directory: ", d) return else: have.append(d) d = os.path.expanduser(d) dispname = utils.get_display_path_for_bytestring(d) gicon = icons.get_gicon_for_file(d) self.dir_store.append((d, gicon, dispname)) if store: setctl = settings.GetSettingsController() setctl.set_directories(have)
def add_directory_model(self, d, store=False): have = list(os.path.normpath(row[0]) for row in self.dir_store) if d in have: self.output_debug("Ignoring duplicate directory: ", d) return else: have.append(d) d = os.path.expanduser(d) dispname = utils.get_display_path_for_bytestring(d) gicon = icons.get_gicon_for_file(d) self.dir_store.append((d, gicon, dispname)) if store: setctl = settings.GetSettingsController() setctl.set_directories(have)
def activate(self, obj, ctx): ## If the same file @obj is already open, ## then close its window. if obj.object in self.open_windows: open_window = self.open_windows.pop(obj.object) open_window.destroy() return image_widget = gtk.Image() h = gtk.gdk.screen_height() w = gtk.gdk.screen_width() image_widget.set_from_pixbuf(load_image_max_size(obj.object, w, h)) image_widget.show() window = gtk.Window() window.set_title(utils.get_display_path_for_bytestring(obj.object)) window.set_position(gtk.WIN_POS_CENTER) window.add(image_widget) ctx.environment.present_window(window) window.connect("key-press-event", self.window_key_press, obj.object) window.connect("delete-event", self.window_deleted, obj.object) self.open_windows[obj.object] = window
def activate(self, obj, ctx): ## If the same file @obj is already open, ## then close its window. if obj.object in self.open_windows: open_window = self.open_windows.pop(obj.object) open_window.destroy() return image_widget = gtk.Image() h = gtk.gdk.screen_height() w = gtk.gdk.screen_width() image_widget.set_from_pixbuf(load_image_max_size(obj.object, w, h)) image_widget.show() window = gtk.Window() window.set_title(utils.get_display_path_for_bytestring(obj.object)) window.set_position(gtk.WIN_POS_CENTER) window.add(image_widget) ctx.environment.present_window(window) window.connect("key-press-event", self.window_key_press, obj.object) window.connect("delete-event", self.window_deleted, obj.object) self.open_windows[obj.object] = window
def thread_do(self): gd_client = picasa_login() if not gd_client: return progress_dialog = ProgressDialogController( _("Uploading Pictures"), _("Uploading pictures to Picasa Web Album"), max_value=self._files_albums_count) progress_dialog.show() try: upass = __kupfer_settings__['userpass'] progress = 0 for files, album_id, album_name in self._files_to_upload: # create album if album_id is None: progress_dialog.update(progress, _("Creating album:"), album_name) album = gd_client.InsertAlbum(title=album_name, summary=_('Album created by Kupfer')) album_id = album.gphoto_id.text progress += 1 # send files album_url = ALBUM_URL % (upass.username, album_id) for filename in files: pretty.print_debug(__name__, 'upload: sending', filename) progress_dialog.update(progress, _('File:'), utils.get_display_path_for_bytestring(filename)) if progress_dialog.aborted: pretty.print_debug(__name__, 'upload: abort') break # send file gd_client.InsertPhotoSimple(album_url, os.path.basename(filename), '', filename) pretty.print_debug(__name__, 'upload: file sended', filename) progress += 1 except (gdata.service.Error, gdata.photos.service.GooglePhotosException), \ err: pretty.print_error(__name__, 'upload error', err)
def get_description(self): return utils.get_display_path_for_bytestring(self.canonical_path())
def get_description(self): orig_path = self.get_orig_path() return utils.get_display_path_for_bytestring(orig_path) if orig_path \ else None
def get_description(self): return _("Volume mounted at %s") % \ utils.get_display_path_for_bytestring(self.object)
def get_description(self): return utils.get_display_path_for_bytestring(self.canonical_path())
def get_description(self): dispname = utils.get_display_path_for_bytestring(self.object) return _("TrueCrypt volume: %(file)s") % dict(file=dispname)
def get_description(self): dispname = utils.get_display_path_for_bytestring(self.object) return _("TrueCrypt volume: %(file)s") % dict(file=dispname)