mirror of
http://git.whoc.org.uk/git/password-manager.git
synced 2024-11-14 18:29:02 +01:00
Updated scripts for python3
This commit is contained in:
parent
8ff8cc9d8d
commit
81a8565710
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: UTF-8 -*-
|
||||
|
||||
import sys
|
||||
@ -92,7 +92,7 @@ def build (settings, repository):
|
||||
# print "\nWARNING: repository has pending changes\n"
|
||||
raise Exception("repository has pending changes, can't 'install'")
|
||||
else:
|
||||
print "\nWARNING: repository has pending changes\n"
|
||||
print ( "\nWARNING: repository has pending changes\n" )
|
||||
|
||||
for frontend in settings['frontends']:
|
||||
normalizedFrontendName = frontend.replace(".", "_")
|
||||
@ -120,17 +120,17 @@ def clean ():
|
||||
|
||||
def usage (message):
|
||||
if message != None:
|
||||
print "ERROR: " + message
|
||||
print ( "ERROR: " + message )
|
||||
|
||||
print
|
||||
print ()
|
||||
# print "build clean"
|
||||
# print "build clean install"
|
||||
print "build install --ALL"
|
||||
print "build install debug --ALL"
|
||||
print "build install debug development --ALL"
|
||||
# print "build clean install debug --ALL"
|
||||
print "build install debug --backends php python --frontends beta gamma"
|
||||
print "build install debug development --backends php python --frontends beta gamma gamma.mobile"
|
||||
print ( "build install --ALL" )
|
||||
print ( "build install debug --ALL" )
|
||||
print ( "build install debug development --ALL" )
|
||||
# print ( "build clean install debug --ALL" )
|
||||
print ( "build install debug --backends php python --frontends beta gamma" )
|
||||
print ( "build install debug development --backends php python --frontends beta gamma gamma.mobile" )
|
||||
exit(1)
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
@ -181,11 +181,11 @@ def main ():
|
||||
settings['backends'] = []
|
||||
settings['backends'].append('checksum')
|
||||
|
||||
if (not settings.has_key('versions')):
|
||||
if 'versions' not in settings:
|
||||
usage("missing 'versions'")
|
||||
if (not settings.has_key('frontends')):
|
||||
if 'frontends' not in settings:
|
||||
usage("missing 'frontends'")
|
||||
if (not settings.has_key('backends')):
|
||||
if 'backends' not in settings:
|
||||
usage("missing 'backends'")
|
||||
|
||||
build(settings, currentRepository)
|
||||
|
@ -14,11 +14,13 @@ def repositoryWithPath (path):
|
||||
from git import Repo
|
||||
repo = Repo(path)
|
||||
result = GitRepository(repo, path)
|
||||
except ImportError, exception:
|
||||
print "Failed to import git, please install http://gitorious.org/git-python"
|
||||
print "Use sudo apt-get install python-git for Ubuntu/Debian"
|
||||
print "Use sudo yum install GitPython for Fedora/RHEL/CentOS"
|
||||
print "Or manually running the following command: easy_install gitpython"
|
||||
except ImportError as exception:
|
||||
import sys
|
||||
print ( sys.version )
|
||||
print ( "Failed to import git, please install http://gitorious.org/git-python" )
|
||||
print ( "Use sudo apt-get install python-git for Ubuntu/Debian" )
|
||||
print ( "Use sudo yum install GitPython for Fedora/RHEL/CentOS" )
|
||||
print ( "Or manually running the following command: easy_install gitpython" )
|
||||
except:
|
||||
result = SnapshotRepository('', path)
|
||||
|
||||
@ -68,7 +70,7 @@ class GitRepository(Repository):
|
||||
def areTherePendingChanges (self):
|
||||
try:
|
||||
return self.repository.is_dirty()
|
||||
except TypeError, te:
|
||||
except TypeError as te:
|
||||
return self.repository.is_dirty
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user