summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2009-10-23 23:47:05 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2009-10-23 23:47:05 +0200
commitc9190e0f9e1969607be5ddf2c59cd2d75b12bdc0 (patch)
tree56fb42723b64ef126bc01caf306c7a75f780516b /plugins
parentce9d81ac44d0a915ba23d5a032cede1bde321729 (diff)
downloadportato-c9190e0f9e1969607be5ddf2c59cd2d75b12bdc0.tar.gz
portato-c9190e0f9e1969607be5ddf2c59cd2d75b12bdc0.tar.bz2
portato-c9190e0f9e1969607be5ddf2c59cd2d75b12bdc0.zip
Turn new_version plugin from a mess into sth useful.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/new_version.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/plugins/new_version.py b/plugins/new_version.py
index 7f110b5..0256520 100644
--- a/plugins/new_version.py
+++ b/plugins/new_version.py
@@ -34,25 +34,25 @@ class NewVersionFinder(WidgetPlugin):
def get_notify_callback (self, rev):
def callback():
- get_listener().send_notify(
- base = "New Portato Live Version Found",
- descr = "The most recent revision is %s." % rev,
- icon = APP_ICON)
- return False
+ get_listener().send_notify(
+ base = "New Portato Live Version Found",
+ descr = "The most recent revision is %s." % rev,
+ icon = APP_ICON)
+ return False
- return callback
+ return callback
def find_version (self, rev):
repo, branch = REPOURI.split('::')
- remote_rev = Popen(['git', 'ls-remote', repo, branch], stdout = PIPE).communicate()[0].split('\t')
+ remote_rev = Popen(['git', 'ls-remote', repo, branch], stdout = PIPE).communicate()[0].strip().split('\t')
if len(remote_rev) and remote_rev[1] not in (branch, 'refs/heads/'+branch, 'refs/tags/'+branch):
warning('NEW_VERSION :: Returned revision information looks strange: %s', str(remote_rev))
else:
remote_rev = remote_rev[0]
- debug("NEW_VERSION :: Installed rev: %s - Current rev: %s", rev, remove_rev)
+ debug("NEW_VERSION :: Installed rev: %s - Current rev: %s", rev, remote_rev)
if rev != remote_rev:
gobject.idle_add(self.get_notify_callback(remote_rev))
@@ -82,4 +82,4 @@ class NewVersionFinder(WidgetPlugin):
if rev is not None:
gobject.timeout_add(30*60*1000, self.start_thread, rev) # call it every 30 minutes
-register(NewVersionFinder, REVISION != '')
+register(NewVersionFinder, REVISION == '')