]> code.delx.au - offlineimap/commitdiff
Fix version.py importing
authorJohn Goerzen <jgoerzen@complete.org>
Tue, 10 Jul 2007 11:57:03 +0000 (12:57 +0100)
committerJohn Goerzen <jgoerzen@complete.org>
Tue, 10 Jul 2007 11:57:03 +0000 (12:57 +0100)
offlineimap/init.py
offlineimap/version.py

index 8d2df1207b4dc6c5b745d8d69fb52a1cfc680b94..480778f1712c937da3d4e67e01fa31c25f3e66e3 100644 (file)
@@ -50,14 +50,14 @@ def startup(versionno):
     assert versionno == version.versionstr, "Revision of main program (%s) does not match that of library (%s).  Please double-check your PYTHONPATH and installation locations." % (versionno, version.versionstr)
     options = {}
     if '--help' in sys.argv[1:]:
-        sys.stdout.write(version.cmdhelp + "\n")
+        sys.stdout.write(version.getcmdhelp() + "\n")
         sys.exit(0)
 
     for optlist in getopt(sys.argv[1:], 'P:1oa:c:d:l:u:h')[0]:
         options[optlist[0]] = optlist[1]
 
     if options.has_key('-h'):
-        sys.stdout.write(version.cmdhelp)
+        sys.stdout.write(version.getcmdhelp())
         sys.stdout.write("\n")
         sys.exit(0)
     configfilename = os.path.expanduser("~/.offlineimaprc")
index c715ab52a4a9077b78103536737ca53841750ca6..36bce80150711ba198871cf7dde234cb3a93b36e 100644 (file)
@@ -34,7 +34,13 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA"""
 
-cmdhelp = """
+def getcmdhelp():
+    from offlineimap.ui import detector
+    import os
+    uilist = ""
+    for ui in detector.DEFAULT_UI_LIST:
+        uilist += "                " + ui + os.linesep
+    return """
        offlineimap [ -1 ] [ -P profiledir ] [ -a accountlist ]  [
        -c configfile  ] [ -d debugtype[,debugtype...]  ] [ -o ] [
        -u interface ]
@@ -102,8 +108,4 @@ cmdhelp = """
               states that it cannot be.   Use  this  option  with
               care.   The  pre-defined  options, described in the
               USER INTERFACES section of the man page, are:
-"""
-from offlineimap.ui import detector
-import os
-for ui in detector.DEFAULT_UI_LIST:
-    cmdhelp += "                " + ui + os.linesep
+""" + uilist