Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

check python2 version and support latest Deluge version from Git #3

Merged
merged 2 commits into from

2 participants

@k2s
  • fixing the script for python 3 would be easy, but because Deluge is developed for Python2 I added only check in run script
  • current Deluge version in Git repository uses gettext library in deluge/common.py so I added gettexrt initialization to conkyDeluge

thx

k2s added some commits
@k2s k2s use python2
current conkyDeluge code is not compatible with Python 3. this shell script detects python 2 library
524d36b
@k2s k2s Fixed compatibility with latest Deluge GIT version, which requires in…
…stalled global gettext function _()
0b58f65
@cas-- cas-- merged commit d847563 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 25, 2012
  1. @k2s

    use python2

    k2s authored
    current conkyDeluge code is not compatible with Python 3. this shell script detects python 2 library
  2. @k2s

    Fixed compatibility with latest Deluge GIT version, which requires in…

    k2s authored
    …stalled global gettext function _()
This page is out of date. Refresh to see the latest.
Showing with 20 additions and 1 deletion.
  1. +17 −1 conkyDeluge
  2. +3 −0  conkyDeluge.py
View
18 conkyDeluge
@@ -1,3 +1,19 @@
#! /bin/sh
cd /usr/share/conkydeluge/
-/usr/bin/python /usr/share/conkydeluge/conkyDeluge.py "$@"
+
+### make sure we use python2
+PYTHONBIN=`which python2 2>/dev/null`
+if [ $? -ne 0 ]; then
+ PYTHONBIN=`which python 2>/dev/null`
+ if [ $? -ne 0 ]; then
+ echo "conkyDeluge requires python2"
+ exit 1
+ fi
+fi
+
+ret=`$PYTHONBIN -c 'import sys; print("%i" % (sys.hexversion<0x03000000))'`
+if [ $ret -eq 0 ]; then
+ echo "conkyDeluge requires python2, higher version is not supported"
+else
+ $PYTHONBIN /usr/share/conkydeluge/conkyDeluge.py "$@"
+fi
View
3  conkyDeluge.py
@@ -8,6 +8,7 @@
# Created: 13/10/2008
#
#Modified:
+# 25/08/2012 Fixed compatibility with latest Deluge GIT version, which requires installed global gettext function _() (by k2s)
# 13/10/2008 Fixed progress % issue with multi-file torrents
# 14/10/2008 Added expected time of arrival (eta) as an output, can be used in the template with <eta>
# 17/10/2008 Updated to import and use deluge sclient and common formatting functions, disabled deluge logging functions too
@@ -40,6 +41,7 @@
# 18/10/2009 Updated to handle new DelugeRPC async methods used in 1.2.0 onwards (will mean this script breaks for previous deluge version users)
from datetime import datetime
+import gettext
from deluge.common import ftime, fsize, fspeed
from deluge.ui.client import client
from twisted.internet import reactor
@@ -540,6 +542,7 @@ def logError(self, text):
fileoutput.close()
def main():
+ gettext.install('conkyDeluge')
parser = CommandLineParser()
(options, args) = parser.parse_args()
Something went wrong with that request. Please try again.