Fix version.py importing

This commit is contained in:
John Goerzen 2007-07-10 12:57:03 +01:00
parent 84d1662482
commit 09d71143d7
2 changed files with 10 additions and 8 deletions

View 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")

View 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