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