install-i18n.py

changeset 12
1d8dd9706f46
parent 7
c679fb30c8f3
child 13
1af94a91f439
--- a/install-i18n.py	Fri Jan 01 16:11:36 2010 +0000
+++ b/install-i18n.py	Sat Jan 02 15:11:35 2010 +0000
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 
 # Copyright (c) 2004 - 2009 Detlev Offenbach <detlev@die-offenbachs.de>
@@ -14,16 +14,12 @@
 import shutil
 import glob
 
-import sip
-sip.setapi("QString", 2)
-sip.setapi("QVariant", 2)
-
 from PyQt4.QtCore import QDir
 
 try:
-    from eric4config import getConfig
+    from .eric4config import getConfig
 except ImportError:
-    print "The eric4 IDE doesn't seem to be installed. Aborting."
+    print("The eric4 IDE doesn't seem to be installed. Aborting.")
     sys.exit(1)
     
 def getConfigDir():
@@ -59,12 +55,12 @@
     """
     global progName, configDir
 
-    print
-    print "Usage:"
-    print "    %s [-hp]" % (progName)
-    print "where:"
-    print "    -h        display this help message"
-    print "    -p        install into the private area (%s)" % (configDir)
+    print()
+    print("Usage:")
+    print("    %s [-hp]" % (progName))
+    print("where:")
+    print("    -h        display this help message")
+    print("    -p        install into the private area (%s)" % (configDir))
 
     sys.exit(rcode)
 
@@ -82,7 +78,7 @@
     try:
         for fn in glob.glob(os.path.join('eric', 'i18n', '*.qm')):
             shutil.copy2(fn, targetDir)
-    except IOError, msg:
+    except IOError as msg:
         sys.stderr.write('IOError: %s\nTry install-i18n as root.\n' % msg)
     
 def main(argv):
@@ -120,8 +116,7 @@
     except SystemExit:
         raise
     except:
-        print \
-"""An internal error occured.  Please report all the output of the program,
+        print("""An internal error occured.  Please report all the output of the program,
 including the following traceback, to eric5-bugs@eric-ide.python-projects.org.
-"""
+""")
         raise

eric ide

mercurial