Beispiel #1
0
	def _make_archive(cls, ctx, basename, dirpath, filepaths):
		archive_type = __kupfer_settings__["archive_type"]
		archive_path = \
			utils.get_destpath_in_directory(dirpath, basename, archive_type)
		cmd = ["file-roller", "--add-to=%s" % (archive_path, )]
		cmd.extend(filepaths)
		runtimehelper.register_async_file_result(ctx, archive_path)
		utils.spawn_async_notify_as("file-roller.desktop", cmd)
		return archive_path
Beispiel #2
0
 def _make_archive(cls, ctx, basename, dirpath, filepaths):
     archive_type = __kupfer_settings__["archive_type"]
     archive_path = \
         utils.get_destpath_in_directory(dirpath, basename, archive_type)
     cmd = ["file-roller", "--add-to=%s" % (archive_path, )]
     cmd.extend(filepaths)
     runtimehelper.register_async_file_result(ctx, archive_path)
     utils.spawn_async_notify_as("file-roller.desktop", cmd)
     return archive_path
Beispiel #3
0
 def activate(self, leaf, obj=None):
     fpath = leaf.object
     dirname = os_path.dirname(fpath)
     head, ext = os_path.splitext(os_path.basename(fpath))
     filename = "%s_%s%s" % (head, self.rotation, ext)
     dpath = utils.get_destpath_in_directory(dirname, filename)
     cmdline = "jpegtran -copy all -rotate '%s' -outfile '%s' '%s'" % (self.rotation, dpath, fpath)
     runtimehelper.register_async_file_result(dpath)
     utils.launch_commandline(cmdline)
     return FileLeaf(dpath)
Beispiel #4
0
	def activate(self, leaf, obj=None):
		fpath = leaf.object
		dirname = os_path.dirname(fpath)
		head, ext = os_path.splitext(os_path.basename(fpath))
		filename = "%s_%s%s" % (head, self.rotation, ext)
		dpath = utils.get_destpath_in_directory(dirname, filename)
		argv = ["jpegtran", "-copy", "all", "-rotate", self.rotation, "-outfile",
		        dpath, fpath]
		runtimehelper.register_async_file_result(dpath)
		utils.spawn_async(argv)
		return FileLeaf(dpath)
Beispiel #5
0
	def activate(self, leaf, obj):
		size = self._make_size(obj.object)
		fpath = leaf.object
		dirname = os_path.dirname(fpath)
		head, ext = os_path.splitext(os_path.basename(fpath))
		filename = "%s_%s%s" % (head, size, ext)
		dpath = utils.get_destpath_in_directory(dirname, filename)
		argv = ["convert", "-scale", ('%s' % size),  fpath, dpath]
		runtimehelper.register_async_file_result(dpath)
		utils.spawn_async(argv)
		return FileLeaf(dpath)
Beispiel #6
0
 def activate(self, leaf, obj, ctx):
     size = self._make_size(obj.object)
     fpath = leaf.object
     dirname = os_path.dirname(fpath)
     head, ext = os_path.splitext(os_path.basename(fpath))
     filename = "%s_%s%s" % (head, size, ext)
     dpath = utils.get_destpath_in_directory(dirname, filename)
     argv = ["convert", "-scale", ('%s' % size), fpath, dpath]
     runtimehelper.register_async_file_result(ctx, dpath)
     spawn_operation_err(argv)
     return FileLeaf(dpath)
Beispiel #7
0
 def activate(self, leaf, obj):
     size = self._make_size(obj.object)
     fpath = leaf.object
     dirname = os_path.dirname(fpath)
     head, ext = os_path.splitext(os_path.basename(fpath))
     filename = "%s_%s%s" % (head, size, ext)
     dpath = utils.get_destpath_in_directory(dirname, filename)
     cmdline = "convert -scale '%s' '%s' '%s'" % (size, fpath, dpath)
     runtimehelper.register_async_file_result(dpath)
     utils.launch_commandline(cmdline)
     return FileLeaf(dpath)
Beispiel #8
0
 def activate(self, leaf, ctx):
     fpath = leaf.object
     dirname = os_path.dirname(fpath)
     head, ext = os_path.splitext(os_path.basename(fpath))
     filename = "%s_%s%s" % (head, self.rotation, ext)
     dpath = utils.get_destpath_in_directory(dirname, filename)
     argv = [
         "jpegtran", "-copy", "all", "-rotate", self.rotation, "-outfile",
         dpath, fpath
     ]
     runtimehelper.register_async_file_result(ctx, dpath)
     spawn_operation_err(argv)
     return FileLeaf(dpath)