diff options
Diffstat (limited to 'lvc')
-rw-r--r-- | lvc/__init__.py | 2 | ||||
-rw-r--r-- | lvc/qtfaststart/__init__.py | 2 | ||||
-rw-r--r-- | lvc/ui/console.py | 36 | ||||
-rw-r--r-- | lvc/variables.py | 1 | ||||
-rw-r--r-- | lvc/widgets/gtk/window.py | 11 | ||||
-rw-r--r-- | lvc/widgets/osx/base.py | 2 | ||||
-rw-r--r-- | lvc/windows/autoupdate.py | 18 |
7 files changed, 41 insertions, 31 deletions
diff --git a/lvc/__init__.py b/lvc/__init__.py index 11fafb7..1564ac3 100644 --- a/lvc/__init__.py +++ b/lvc/__init__.py @@ -6,8 +6,6 @@ from lvc import conversion from lvc import signals from lvc import video -VERSION = '1.0.1' - class Application(signals.SignalEmitter): diff --git a/lvc/qtfaststart/__init__.py b/lvc/qtfaststart/__init__.py index f985b5c..8b13789 100644 --- a/lvc/qtfaststart/__init__.py +++ b/lvc/qtfaststart/__init__.py @@ -1 +1 @@ -VERSION = "1.6" + diff --git a/lvc/ui/console.py b/lvc/ui/console.py index a0c373b..871bfd6 100644 --- a/lvc/ui/console.py +++ b/lvc/ui/console.py @@ -5,12 +5,17 @@ import time import sys import lvc + +from lvc.variables import ( + __version__ +) + from lvc.widgets import app from lvc.widgets import initialize parser = optparse.OptionParser( usage='%prog [-l] [--list-converters] [-c <converter> <filenames..>]', - version='%prog ' + lvc.VERSION, + version='%prog ' + __version__, prog='python -m lvc.ui.console') parser.add_option('-j', '--json', action='store_true', dest='json', @@ -31,12 +36,12 @@ class Application(lvc.Application): for c in sorted(self.converter_manager.list_converters(), key=operator.attrgetter('name')): if options.json: - print json.dumps({'name': c.name, - 'identifier': c.identifier}) + print(json.dumps({'name': c.name, + 'identifier': c.identifier})) else: - print '%s (-c %s)' % ( + print('%s (-c %s)' % ( c.name, - c.identifier) + c.identifier)) return try: @@ -45,12 +50,12 @@ class Application(lvc.Application): message = '%r is not a valid converter type.' % ( options.converter,) if options.json: - print json.dumps({'error': message}) + print(json.dumps({'error': message})) else: - print 'ERROR:', message - print 'Use "%s -l" to get a list of valid converters.' % ( - parser.prog,) - print + print('ERROR:', message) + print('Use "%s -l" to get a list of valid converters.' % ( + parser.prog,)) + print('') parser.print_help() sys.exit(1) @@ -71,7 +76,7 @@ class Application(lvc.Application): } if c.error is not None: output['error'] = c.error - print json.dumps(output) + print(json.dumps(output)) else: if c.status == 'initialized': line = 'starting (output: %s)' % (c.output,) @@ -89,7 +94,7 @@ class Application(lvc.Application): line = 'finished (output: %s)' % (c.output,) else: line = c.status - print '%s: %s' % (c.video.filename, line) + print('%s: %s' % (c.video.filename, line)) for filename in args: try: @@ -98,10 +103,10 @@ class Application(lvc.Application): message = 'could not parse %r' % filename if options.json: any_failed = True - print json.dumps({'status': 'failed', 'error': message, - 'filename': filename}) + print(json.dumps({'status': 'failed', 'error': message, + 'filename': filename})) else: - print 'ERROR:', message + print('ERROR:', message) continue changed(c) c.listen(changed) @@ -114,6 +119,7 @@ class Application(lvc.Application): sys.exit(0 if not any_failed else 1) + if __name__ == "__main__": initialize(None) app.widgetapp = Application() diff --git a/lvc/variables.py b/lvc/variables.py new file mode 100644 index 0000000..1a72d32 --- /dev/null +++ b/lvc/variables.py @@ -0,0 +1 @@ +__version__ = '1.1.0' diff --git a/lvc/widgets/gtk/window.py b/lvc/widgets/gtk/window.py index 18d91a2..62eb19a 100644 --- a/lvc/widgets/gtk/window.py +++ b/lvc/widgets/gtk/window.py @@ -36,6 +36,10 @@ import os from lvc import resources from lvc import signals +from lvc.variables import ( + __version__ +) + import keymap import layout import widgets @@ -110,6 +114,7 @@ class WrappedWindow(gtk.Window): if not self.change_focus_using_wrapper(direction): gtk.Window.do_focus(self, direction) + gobject.type_register(WrappedWindow) @@ -625,16 +630,15 @@ class AboutDialog(Dialog): # app.config.get(prefs.APP_REVISION_NUM)) # else: # version = "%s" % app.config.get(prefs.APP_VERSION) - version = '1.0.1' # name_label = gtk.Label( # '<span size="xx-large" weight="bold">%s %s</span>' % ( # app.config.get(prefs.SHORT_APP_NAME), version)) name_label = gtk.Label( '<span size="xx-large" weight="bold">%s %s</span>' % ( - 'Libre Video Converter', version)) + 'Libre Video Converter', __version__)) name_label.set_use_markup(True) packing_vbox._widget.pack_start(name_label) - copyright_text = 'Copyright (c) Jesus Eduardo (Heckyel) | 2017' + copyright_text = 'Copyright (c) Jesus E. 2017 - 2020' copyright_label = gtk.Label('<small>%s</small>' % copyright_text) copyright_label.set_use_markup(True) copyright_label.set_justify(gtk.JUSTIFY_CENTER) @@ -689,6 +693,7 @@ class AboutDialog(Dialog): resources.open_url( 'https://notabug.org/heckyel/librevideoconverter') + type_map = { 0: gtk.MESSAGE_WARNING, 1: gtk.MESSAGE_INFO, diff --git a/lvc/widgets/osx/base.py b/lvc/widgets/osx/base.py index 234f266..b24b126 100644 --- a/lvc/widgets/osx/base.py +++ b/lvc/widgets/osx/base.py @@ -121,7 +121,7 @@ class Widget(signals.SignalEmitter): height = int(request[1]) indent = ' ' * nesting_level me = str(self.__class__).split('.')[-1] - print '%s%s: %sx%s' % (indent, me, width, height) + print('%s%s: %sx%s' % (indent, me, width, height)) def place(self, rect, containing_view): """Place this widget on a view. """ diff --git a/lvc/windows/autoupdate.py b/lvc/windows/autoupdate.py index 834a45f..ba2e271 100644 --- a/lvc/windows/autoupdate.py +++ b/lvc/windows/autoupdate.py @@ -77,7 +77,7 @@ def open_or_create_key(key, subkey, write_access=False): sam = winreg.KEY_READ try: return winreg.OpenKey(key, subkey, 0, sam) - except OSError, e: + except OSError as e: if e.errno == 2: # Not Found error. We should create the key return winreg.CreateKey(key, subkey) @@ -88,14 +88,14 @@ def open_or_create_key(key, subkey, write_access=False): def check_for_updates_set(winsparkle_key): try: winreg.QueryValueEx(winsparkle_key, "CheckForUpdates") - except OSError, e: - if e.errno == 2: - # not found error. - return False - else: - raise - else: - return True + except OSError as e: + if e.errno == 2: + # not found error. + return False + else: + raise + else: + return True def set_default_check_for_updates(winsparkle_key): |