You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gump.apache.org by aj...@apache.org on 2020/11/30 21:45:39 UTC
svn commit: r1883964 [1/3] - in /gump/live: ./ bin/ cron/
python/gump/actor/document/ python/gump/actor/document/text/
python/gump/actor/document/xdocs/ python/gump/actor/mvnrepoproxy/
python/gump/actor/notify/ python/gump/actor/repository/ python/gump...
Author: ajack
Date: Mon Nov 30 21:45:38 2020
New Revision: 1883964
URL: http://svn.apache.org/viewvc?rev=1883964&view=rev
Log:
Merged branch "python3" into "live" using svn merge ^/gump/branches/python3/
Modified:
gump/live/ (props changed)
gump/live/bin/integrate.py
gump/live/bin/preview.py
gump/live/bin/repo.py
gump/live/bin/testrunner.py
gump/live/cron/gump.py
gump/live/cron/gump.sh
gump/live/python/gump/actor/document/documenter.py
gump/live/python/gump/actor/document/resolver.py
gump/live/python/gump/actor/document/text/documenter.py
gump/live/python/gump/actor/document/text/resolver.py
gump/live/python/gump/actor/document/xdocs/documenter.py
gump/live/python/gump/actor/document/xdocs/resolver.py
gump/live/python/gump/actor/document/xdocs/xdoc.py
gump/live/python/gump/actor/mvnrepoproxy/proxycontrol.py
gump/live/python/gump/actor/notify/notification.py
gump/live/python/gump/actor/notify/notifier.py
gump/live/python/gump/actor/repository/artifact.py
gump/live/python/gump/actor/repository/publisher.py
gump/live/python/gump/actor/results/loader.py
gump/live/python/gump/actor/results/model.py
gump/live/python/gump/actor/results/resulter.py
gump/live/python/gump/actor/stats/dbm/statsdb.py
gump/live/python/gump/actor/stats/mysql/statsdb.py
gump/live/python/gump/actor/stats/statistician.py
gump/live/python/gump/actor/syndication/abstract.py
gump/live/python/gump/actor/syndication/syndicator.py
gump/live/python/gump/core/build/basebuilder.py
gump/live/python/gump/core/build/builder.py
gump/live/python/gump/core/build/gradle.py
gump/live/python/gump/core/build/maven.py
gump/live/python/gump/core/build/mvn.py
gump/live/python/gump/core/commandLine.py
gump/live/python/gump/core/config.py
gump/live/python/gump/core/language/java.py (contents, props changed)
gump/live/python/gump/core/language/path.py
gump/live/python/gump/core/loader/loader.py
gump/live/python/gump/core/model/builder.py
gump/live/python/gump/core/model/depend.py
gump/live/python/gump/core/model/misc.py
gump/live/python/gump/core/model/module.py
gump/live/python/gump/core/model/object.py
gump/live/python/gump/core/model/profile.py
gump/live/python/gump/core/model/project.py
gump/live/python/gump/core/model/propagation.py
gump/live/python/gump/core/model/property.py
gump/live/python/gump/core/model/repository.py
gump/live/python/gump/core/model/server.py
gump/live/python/gump/core/model/stats.py
gump/live/python/gump/core/model/workspace.py
gump/live/python/gump/core/run/actor.py
gump/live/python/gump/core/run/gumpenv.py
gump/live/python/gump/core/run/gumprun.py
gump/live/python/gump/core/run/gumpset.py
gump/live/python/gump/core/runner/demand.py
gump/live/python/gump/core/runner/runner.py
gump/live/python/gump/core/update/scmupdater.py
gump/live/python/gump/core/update/updater.py
gump/live/python/gump/test/artifacts.py
gump/live/python/gump/test/describer.py
gump/live/python/gump/test/diagram.py
gump/live/python/gump/test/documenter.py
gump/live/python/gump/test/integrator.py
gump/live/python/gump/test/language.py
gump/live/python/gump/test/loading.py
gump/live/python/gump/test/maven.py
gump/live/python/gump/test/mockobjects.py
gump/live/python/gump/test/model.py
gump/live/python/gump/test/nant.py
gump/live/python/gump/test/notifying.py
gump/live/python/gump/test/pyunit.py
gump/live/python/gump/test/resolving.py
gump/live/python/gump/test/resources/full1/module1.xml
gump/live/python/gump/test/stats.py
gump/live/python/gump/test/svg.py
gump/live/python/gump/test/sync.py
gump/live/python/gump/test/syndicator.py
gump/live/python/gump/test/testExample.py
gump/live/python/gump/test/threads.py
gump/live/python/gump/test/timing.py
gump/live/python/gump/test/unicode.py
gump/live/python/gump/test/updater.py
gump/live/python/gump/test/utils.py
gump/live/python/gump/test/xdocs.py
gump/live/python/gump/test/xref.py
gump/live/python/gump/tool/guru/xref.py
gump/live/python/gump/tool/integration/cvs.py
gump/live/python/gump/tool/performance/deps.py
gump/live/python/gump/tool/performance/gurus.py
gump/live/python/gump/tool/performance/xdocs.py
gump/live/python/gump/tool/shared/comparator.py
gump/live/python/gump/tool/svg/depdiag.py
gump/live/python/gump/tool/svg/drawing.py
gump/live/python/gump/tool/svg/svg.py
gump/live/python/gump/util/__init__.py
gump/live/python/gump/util/domutils.py
gump/live/python/gump/util/file.py
gump/live/python/gump/util/http.py
gump/live/python/gump/util/locks.py
gump/live/python/gump/util/mysql.py
gump/live/python/gump/util/owner.py
gump/live/python/gump/util/process/command.py
gump/live/python/gump/util/process/launcher.py
gump/live/python/gump/util/smtp.py
gump/live/python/gump/util/sync.py
gump/live/python/gump/util/tasks.py
gump/live/python/gump/util/threads/tools.py
gump/live/python/gump/util/timing.py
gump/live/python/gump/util/tools.py
gump/live/python/gump/util/work.py
gump/live/python/misc/pgrp.py
gump/live/python/tool/commitCheck.py
gump/live/python/tool/profileResults.py
gump/live/test/gumptest.sh
Propchange: gump/live/
------------------------------------------------------------------------------
Merged /gump/branches/python3:r1883918-1883963
Modified: gump/live/bin/integrate.py
URL: http://svn.apache.org/viewvc/gump/live/bin/integrate.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/bin/integrate.py (original)
+++ gump/live/bin/integrate.py Mon Nov 30 21:45:38 2020
@@ -77,7 +77,7 @@ def irun():
options.setQuick(False)
options.setCache(False)
- if not os.environ.has_key('GUMP_WORK_OFFLINE'):
+ if 'GUMP_WORK_OFFLINE' not in os.environ:
options.setObjectives(gump.core.run.options.OBJECTIVE_INTEGRATE)
else:
options.setCache(True)
Modified: gump/live/bin/preview.py
URL: http://svn.apache.org/viewvc/gump/live/bin/preview.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/bin/preview.py (original)
+++ gump/live/bin/preview.py Mon Nov 30 21:45:38 2020
@@ -91,37 +91,37 @@ def prun():
languageHelper=runner.getJavaHelper()
for module in run.getGumpSet().getModules():
- print SEPARATOR
- print `module`
+ print(SEPARATOR)
+ print(repr(module))
if debug:
- print module.getXml()
+ print(module.getXml())
module.dump()
if module.isUpdatable():
updater.preview(module)
for project in run.getGumpSet().getProjects():
- print SEPARATOR
- print `project`
+ print(SEPARATOR)
+ print(repr(project))
if debug:
- print project.getXml()
+ print(project.getXml())
project.dump()
if project.hasBuilder():
builder.preview(project, languageHelper)
# Show any nasties...
if workspace.containsNasties():
- print SEPARATOR
- print `workspace`
+ print(SEPARATOR)
+ print(repr(workspace))
Annotatable.dump(workspace)
for module in run.getGumpSet().getModules():
if module.containsNasties():
- print SEPARATOR
- print `module`
+ print(SEPARATOR)
+ print(repr(module))
Annotatable.dump(module)
for project in run.getGumpSet().getProjects():
if project.containsNasties():
- print SEPARATOR
- print `project`
+ print(SEPARATOR)
+ print(repr(project))
Annotatable.dump(project)
# bye!
Modified: gump/live/bin/repo.py
URL: http://svn.apache.org/viewvc/gump/live/bin/repo.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/bin/repo.py (original)
+++ gump/live/bin/repo.py Mon Nov 30 21:45:38 2020
@@ -32,7 +32,7 @@ import pprint
from gump import log
from gump.core.gumpinit import gumpinit
-import gump.repository.artifact
+import gump.actor.repository.artifact
# static void main()
if __name__=='__main__':
@@ -41,19 +41,19 @@ if __name__=='__main__':
result = 1
if not len(sys.argv) >= 1:
- raise RuntimeError, 'Usage: repo.py \'repo directory\' [\'clean\']'
+ raise RuntimeError('Usage: repo.py \'repo directory\' [\'clean\']')
dir = sys.argv[1]
clean = len(sys.argv) == 2
- if not os.path.exists(dir): raise RuntimeError, 'No such directory : ' + `dir`
- if not os.path.isdir(dir): raise RuntimeError, 'Not a directory : ' + `dir`
+ if not os.path.exists(dir): raise RuntimeError('No such directory : ' + repr(dir))
+ if not os.path.isdir(dir): raise RuntimeError('Not a directory : ' + repr(dir))
repo=gump.repository.artifact.ArtifactRepository(dir)
for group in repo.getGroups():
- print '---------------------------------------------------------'
- print 'Group : ' + group
+ print('---------------------------------------------------------')
+ print('Group : ' + group)
pprint.pprint(repo.extractGroup(group))
log.info('Gump Repository Tool Complete. Exit code:' + str(result))
Modified: gump/live/bin/testrunner.py
URL: http://svn.apache.org/viewvc/gump/live/bin/testrunner.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/bin/testrunner.py (original)
+++ gump/live/bin/testrunner.py Mon Nov 30 21:45:38 2020
@@ -40,6 +40,7 @@ import sys
import time
import traceback
import unittest
+from functools import reduce
VERBOSE = 2
@@ -124,7 +125,7 @@ class TestRunner:
def getSuiteFromFile(self, filepath):
if not os.path.isfile(filepath):
- raise ValueError, '%s is not a file' % filepath
+ raise ValueError('%s is not a file' % filepath)
path, filename = os.path.split(filepath)
name, ext = os.path.splitext(filename)
file, pathname, desc = imp.find_module(name, [path])
@@ -187,7 +188,7 @@ class TestRunner:
verbose_on_error=self.verbose_on_error)
def report(self, message):
- print >>sys.stderr, message
+ print(message, file=sys.stderr)
def runAllTests(self):
"""Run all tests found in the current working directory and
@@ -202,9 +203,9 @@ class TestRunner:
names.remove(ignore)
if '.testinfo' in names: # allow local control
f = open(os.path.join(pathname, '.testinfo'))
- lines = filter(None, f.readlines())
- lines = map(lambda x: x[-1]=='\n' and x[:-1] or x, lines)
- names = filter(lambda x: x and x[0] != '#', lines)
+ lines = [_f for _f in f.readlines() if _f]
+ lines = [x[-1]=='\n' and x[:-1] or x for x in lines]
+ names = [x for x in lines if x and x[0] != '#']
f.close()
return names
@@ -291,7 +292,7 @@ class FancyTestResult(unittest._TextTest
verbose_on_error = 0
def __init__(self, *args, **kw):
- if "verbose_on_error" in kw.keys():
+ if "verbose_on_error" in list(kw.keys()):
self.verbose_on_error = kw["verbose_on_error"]
del kw["verbose_on_error"]
unittest._TextTestResult.__init__(self, *args, **kw)
@@ -347,7 +348,7 @@ def excname(cls):
class FancyTestRunner(unittest.TextTestRunner):
def __init__(self, *args, **kw):
- if "verbose_on_error" in kw.keys():
+ if "verbose_on_error" in list(kw.keys()):
self.verbose_on_error = kw["verbose_on_error"]
del kw["verbose_on_error"]
else:
@@ -434,7 +435,7 @@ def setconfig(**kw):
pass
else:
config = App.config.getConfiguration()
- for key, value in kw.items():
+ for key, value in list(kw.items()):
setattr(config, key, value)
App.config.setConfiguration(config)
@@ -472,19 +473,19 @@ def walk_with_symlinks(path, visit, arg)
def remove_stale_bytecode(arg, dirname, names):
- names = map(os.path.normcase, names)
+ names = list(map(os.path.normcase, names))
for name in names:
if name.endswith(".pyc") or name.endswith(".pyo"):
srcname = name[:-1]
if srcname not in names:
fullname = os.path.join(dirname, name)
- print >>sys.stderr, "Removing stale bytecode file", fullname,
+ print("Removing stale bytecode file", fullname, end=' ', file=sys.stderr)
try:
os.unlink(fullname)
- except (OSError, IOError), e:
- print >>sys.stderr, ' --> %s (errno %d)' % (e.strerror, e.errno)
+ except (OSError, IOError) as e:
+ print(' --> %s (errno %d)' % (e.strerror, e.errno), file=sys.stderr)
else:
- print >>sys.stderr
+ print(file=sys.stderr)
def main(args):
@@ -595,7 +596,7 @@ def main(args):
try:
options, arg = getopt.getopt(args, 'aempPhd:f:v:qMo:t:iI:kKC:')
- except getopt.GetoptError, e:
+ except getopt.GetoptError as e:
err_exit(e.msg)
if not options:
@@ -683,7 +684,7 @@ def main(args):
if zope_config:
zope_config = realpath(zope_config)
if verbosity > 0:
- print >>sys.stderr, 'Parsing', zope_config
+ print('Parsing', zope_config, file=sys.stderr)
import Zope
Zope.configure(zope_config)
# Ignore softwarehome from config
Modified: gump/live/cron/gump.py
URL: http://svn.apache.org/viewvc/gump/live/cron/gump.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/cron/gump.py (original)
+++ gump/live/cron/gump.py Mon Nov 30 21:45:38 2020
@@ -56,7 +56,7 @@ def runCommand(command, args = '', dir =
if not os.path.exists(cwdpath):
os.makedirs(dir)
os.chdir(cwdpath)
- except Exception, details :
+ except Exception as details :
# Log the problem and re-raise
log.write('Failed to create/change CWD [' + cwdpath + \
']. Details: ' + str(details) + '\n')
@@ -97,7 +97,7 @@ def runCommand(command, args = '', dir =
os.remove(outputFile)
if exit_code:
- log.write('Process Exit Code : ' + `exit_code` + '\n')
+ log.write('Process Exit Code : ' + repr(exit_code) + '\n')
finally:
if originalCWD:
@@ -131,8 +131,8 @@ def sendEmail(toaddr, fromaddr, subject,
server.sendmail(fromaddr, toaddr, rawdata)
server.quit()
- except Exception, details:
- print 'Failed to send mail: ' + str(details)
+ except Exception as details:
+ print ('Failed to send mail: ' + str(details))
def writeRunLogEntry(entry):
# Enable a run log
@@ -140,16 +140,16 @@ def writeRunLogEntry(entry):
runlogFile = os.path.abspath(os.path.join('log', runlogFileName))
runlog = None
try:
- runlog = open(runlogFile, 'a', 0) # Unbuffered...
+ runlog = open(runlogFile, 'a')
try:
runlog.write(time.strftime('%d %b %Y %H:%M:%S'))
runlog.write(' : ')
- runlog.write(`os.getpid()`)
+ runlog.write(repr(os.getpid()))
runlog.write(' : ')
runlog.write(entry)
runlog.write('\n')
- except Exception, details:
- print 'Failed to write to runlog : ' + str(details)
+ except Exception as details:
+ print ('Failed to write to runlog : ' + str(details))
finally:
if runlog:
runlog.close()
@@ -163,7 +163,7 @@ def establishLock(lockFile):
import fcntl
try:
- lock = open(lockFile, 'a + ')
+ lock = open(lockFile, 'a')
fcntl.flock(lock.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB)
except:
failed = 1
@@ -180,14 +180,14 @@ def establishLock(lockFile):
writeRunLogEntry('False Start. The lock file [%s] exists%s' % \
(lockFile, info))
- print """The lock file [%s] exists%s.
+ print ("""The lock file [%s] exists%s.
Either Gump is still running, or it terminated very abnormally.
Please resolve this (waiting or removing the lock file) before retrying.
- """ % (lockFile, info)
+ """ % (lockFile, info))
sys.exit(1)
# Leave a mark...
- lock.write(`os.getpid()`)
+ lock.write(repr(os.getpid()))
lock.flush()
return lock
@@ -239,8 +239,8 @@ def tailFile(file, lines, _eol = None, _
finally:
if o:
o.close()
- except Exception, details:
- print 'Failed to tail :' + file + ' : ' + str(details)
+ except Exception as details:
+ print ('Failed to tail :' + file + ' : ' + str(details))
return taillines
@@ -252,7 +252,7 @@ def run_prepost_script(env_var, script_t
runs a local PRE or POST script if the corresponding environment
variable has been specified and the script exists.
"""
- if os.environ.has_key(env_var):
+ if env_var in os.environ:
pp_script = os.environ[env_var]
if not os.path.exists(pp_script):
pp_script = os.path.join(start_dir, pp_script)
@@ -317,10 +317,10 @@ def doRun():
log.write('- GUMP run @ UTC : ' + \
time.strftime('%d %b %Y %H:%M:%S',
time.gmtime()) + '\n')
- log.write('- GUMP run by Python : ' + `sys.version` + '\n')
- log.write('- GUMP run by Python : ' + `sys.executable` + '\n')
+ log.write('- GUMP run by Python : ' + repr(sys.version) + '\n')
+ log.write('- GUMP run by Python : ' + repr(sys.executable) + '\n')
log.write('- GUMP run by Gump : ' + GUMP_VERSION + '\n')
- log.write('- GUMP run on OS : ' + `os.name` + '\n')
+ log.write('- GUMP run on OS : ' + repr(os.name) + '\n')
log.write('- GUMP run in env : \n')
for envkey in os.environ.keys():
@@ -329,7 +329,7 @@ def doRun():
# Workspace is the hostname, unless overridden
workspaceName = os.path.abspath('metadata/' + hostname + '.xml')
- if os.environ.has_key('GUMP_WORKSPACE'):
+ if 'GUMP_WORKSPACE' in os.environ:
workspaceName = os.environ['GUMP_WORKSPACE'] + '.xml'
if len(args)>2 and args[1] in ['-w', '--workspace']:
workspaceName = args[2]
@@ -337,7 +337,7 @@ def doRun():
workspacePath = workspaceName
projectsExpr = 'all'
- if os.environ.has_key('GUMP_PROJECTS'):
+ if 'GUMP_PROJECTS' in os.environ:
projectsExpr = os.environ['GUMP_PROJECTS']
if len(args)>1:
projectsExpr = args[1]
@@ -365,7 +365,7 @@ def doRun():
# LSD: this is kinda lame way to parse this
# better to just validate against a DTD
raise RuntimeError('Need one (only) <workspace> tag. Found ' + \
- ` workspaceElementList.length` + '.')
+ repr( workspaceElementList.length) + '.')
wsw = workspaceElementList.item(0)
wsName = wsw.getAttribute('name')
# Extract the base directory
@@ -400,7 +400,7 @@ def doRun():
# Add Gump to Python Path...
pythonPath = ''
- if os.environ.has_key('PYTHONPATH'):
+ if 'PYTHONPATH' in os.environ:
pythonPath = os.environ['PYTHONPATH']
pythonPath += os.pathsep
pythonDir = str(os.path.abspath(os.path.join(os.getcwd(),
@@ -420,8 +420,8 @@ def doRun():
os.remove(fullname)
# Update Gump code from SVN
- if not os.environ.has_key('GUMP_NO_SVN_UPDATE') and \
- not os.environ.has_key('GUMP_NO_SCM_UPDATE'):
+ if not 'GUMP_NO_SVN_UPDATE' in os.environ and \
+ not 'GUMP_NO_SCM_UPDATE' in os.environ:
svnExit = runCommand('svn', 'update --non-interactive')
else:
log.write('SVN update skipped per environment setting.\n')
@@ -494,15 +494,15 @@ def doRun():
logFileName)))
try:
- publishedLog = open(publishedLogFile, 'w', 0) # Unbuffered...
+ publishedLog = open(publishedLogFile, 'w')
catFile(publishedLog, logFile, logTitle)
publishedLog.close()
published = True
- except Exception, details:
- print 'Failed to publish log file. ', str(details)
+ except Exception as details:
+ print ('Failed to publish log file. ', str(details))
published = False
else:
- print 'Unable to publish log file.'
+ print ('Unable to publish log file.')
if result:
# Cat to screen (if running to screen)
@@ -556,8 +556,8 @@ def doRun():
mailport)
else:
- print 'Unable to mail failure report : ' + \
- `[mailserver, mailport, mailto, mailfrom]`
+ print ('Unable to mail failure report : ' + \
+ repr([mailserver, mailport, mailto, mailfrom]))
writeRunLogEntry('Complete [%s svn:%s, run:%s]' % \
@@ -583,7 +583,7 @@ if not os.path.isdir(logDir):
runDateTime = time.strftime('%d%m%Y_%H%M%S')
logFileName = 'gump_log_' + runDateTime + '.txt'
logFile = os.path.abspath(os.path.join(logDir, logFileName))
-log = open(logFile, 'w', 0) # Unbuffered...
+log = open(logFile, 'w')
if '--debug' in sys.argv:
import pdb
Modified: gump/live/cron/gump.sh
URL: http://svn.apache.org/viewvc/gump/live/cron/gump.sh?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/cron/gump.sh (original)
+++ gump/live/cron/gump.sh Mon Nov 30 21:45:38 2020
@@ -42,11 +42,11 @@ export HOST_LOCAL_PRE_RUN=local-pre-run-
export HOST_LOCAL_POST_RUN=local-post-run-${GUMP_HOST}.sh
if [ "" == "$GUMP_PYTHON" ] ; then
- export GUMP_PYTHON="`which python2`"
+ export GUMP_PYTHON="`which python3`"
if [ "" == "$GUMP_PYTHON" ] ; then
export GUMP_PYTHON="`which python`"
if [ "" == "$GUMP_PYTHON" ] ; then
- echo "No Python (python2 nor python) found in path."
+ echo "No Python (python3 nor python) found in path."
exit 1
fi
fi
Modified: gump/live/python/gump/actor/document/documenter.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/actor/document/documenter.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/python/gump/actor/document/documenter.py (original)
+++ gump/live/python/gump/actor/document/documenter.py Mon Nov 30 21:45:38 2020
@@ -54,7 +54,7 @@ class Documenter(gump.core.run.actor.Abs
def prepare(self):
if not hasattr(self,'prepareRun'): return
if not callable(self.prepareRun): return
- log.debug('Prepare to document run using [' + `self` + ']')
+ log.debug('Prepare to document run using [' + repr(self) + ']')
self.prepareRun()
#
@@ -62,14 +62,12 @@ class Documenter(gump.core.run.actor.Abs
#
def document(self):
if not hasattr(self,'documentRun'):
- raise RuntimeError, \
- 'Class [' + `self.__class__` + '] needs a documentRun(self,run)'
+ raise RuntimeError('Class [' + repr(self.__class__) + '] needs a documentRun(self,run)')
if not callable(self.documentRun):
- raise RuntimeError, \
- 'Class [' + `self.__class__` + '] needs a callable documentRun(self,run)'
+ raise RuntimeError('Class [' + repr(self.__class__) + '] needs a callable documentRun(self,run)')
- log.info('Document run using [' + `self` + ']')
+ log.info('Document run using [' + repr(self) + ']')
self.documentRun()
Modified: gump/live/python/gump/actor/document/resolver.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/actor/document/resolver.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/python/gump/actor/document/resolver.py (original)
+++ gump/live/python/gump/actor/document/resolver.py Mon Nov 30 21:45:38 2020
@@ -25,7 +25,6 @@ import os
import sys
import logging
from xml.sax.saxutils import escape
-from string import lower,replace
from gump import log
from gump.core.config import *
@@ -190,7 +189,7 @@ class FileSpecification:
return self.__str__()
def __str__(self):
- return `self.root`+':'+`self.path`+':'+`self.document`
+ return repr(self.root)+':'+repr(self.path)+':'+repr(self.document)
def setRoot(self,root):
self.root=root
@@ -241,7 +240,7 @@ class Location(FileSpecification):
return self.__str__()
def __str__(self):
- return FileSpecification.__str__(self)+':'+`self.index`
+ return FileSpecification.__str__(self)+':'+repr(self.index)
def setIndex(self,index):
self.index=index
@@ -291,7 +290,7 @@ class Resolver:
# Skeleton
def getDirectoryRelativePath(self,object):
- raise RuntimeError, 'Not Implemented on ' + self.__class__.__name__ + ': getDirectoryRelativePath.'
+ raise RuntimeError('Not Implemented on ' + self.__class__.__name__ + ': getDirectoryRelativePath.')
def getDirectoryPath(self,object):
path=self.getDirectoryRelativePath(object)
@@ -303,16 +302,16 @@ class Resolver:
return os.path.join(self.xdocsDir,path.serialize())
def getFileSpec(self,object,documentName=None,extn=None,rawContent=False):
- raise RuntimeError, 'Not Implemented on ' + self.__class__.__name__ + ': getFileSpec.'
+ raise RuntimeError('Not Implemented on ' + self.__class__.__name__ + ': getFileSpec.')
def getFile(self,object,documentName=None,extn=None,rawContent=False):
- raise RuntimeError, 'Not Implemented on ' + self.__class__.__name__ + ': getFile.'
+ raise RuntimeError('Not Implemented on ' + self.__class__.__name__ + ': getFile.')
def getDirectoryUrl(self,object):
- raise RuntimeError, 'Not Implemented on ' + self.__class__.__name__ + ': getDirectoryUrl.'
+ raise RuntimeError('Not Implemented on ' + self.__class__.__name__ + ': getDirectoryUrl.')
def getUrl(self,object,documentName=None,extn=None):
- raise RuntimeError, 'Not Implemented on ' + self.__class__.__name__ + ': getUrl.'
+ raise RuntimeError('Not Implemented on ' + self.__class__.__name__ + ': getUrl.')
def getAbsoluteUrlForRelative(self,relativeToRoot):
"""
@@ -321,16 +320,16 @@ class Resolver:
return concatenateUrl(self.rootUrl,relativeToRoot)
def getStateIconInformation(self,statePair):
- raise RuntimeError, 'Not Implemented on ' + self.__class__.__name__ + ': getStateIconInformation.'
+ raise RuntimeError('Not Implemented on ' + self.__class__.__name__ + ': getStateIconInformation.')
def getAbsoluteImageUrl(self,name):
return self.getAbsoluteFromRelative(self.getImageUrl(name))
def getImageUrl(self,name,depth=0):
- raise RuntimeError, 'Not Implemented on ' + self.__class__.__name__ + ': getImageUrl.'
+ raise RuntimeError('Not Implemented on ' + self.__class__.__name__ + ': getImageUrl.')
def getAbsoluteIconUrl(self,name):
return self.getAbsoluteFromRelative(self.getIconUrl(name))
def getIconUrl(self,name,depth=0):
- raise RuntimeError, 'Not Implemented on ' + self.__class__.__name__ + ': getIconUrl.'
+ raise RuntimeError('Not Implemented on ' + self.__class__.__name__ + ': getIconUrl.')
Modified: gump/live/python/gump/actor/document/text/documenter.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/actor/document/text/documenter.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/python/gump/actor/document/text/documenter.py (original)
+++ gump/live/python/gump/actor/document/text/documenter.py Mon Nov 30 21:45:38 2020
@@ -173,10 +173,10 @@ class TextDocumenter(Documenter):
if work.command.cwd:
output.write(indent+"Work Cwd : " + work.command.cwd + "\n")
if work.command.env:
- for envKey in work.command.env.keys():
+ for envKey in list(work.command.env.keys()):
output.write(indent+"Work Env : " + envKey + ' : '+work.command.env[envKey])
if work.result.signal:
- output.write(indent+"Work Signal : " + `work.result.signal` + "\n")
+ output.write(indent+"Work Signal : " + repr(work.result.signal) + "\n")
output.write(indent+"Work Exit : " + str(work.result.exit_code) + "\n")
if realtime and work.result.hasOutput():
Modified: gump/live/python/gump/actor/document/text/resolver.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/actor/document/text/resolver.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/python/gump/actor/document/text/resolver.py (original)
+++ gump/live/python/gump/actor/document/text/resolver.py Mon Nov 30 21:45:38 2020
@@ -31,7 +31,6 @@ import os
import sys
import logging
from xml.sax.saxutils import escape
-from string import lower,replace
from gump import log
from gump.core.config import *
@@ -62,22 +61,22 @@ class TextResolver(Resolver):
return self.getRootDir()
def getFile(self,object,documentName=None,extn=None,rawContent=False):
- raise RuntimeError, 'Not Implemented on ' + self.__class__.__name__ + ': getFile.'
+ raise RuntimeError('Not Implemented on ' + self.__class__.__name__ + ': getFile.')
def getDirectoryUrl(self,object):
- raise RuntimeError, 'Not Implemented on ' + self.__class__.__name__ + ': getDirectoryUrl.'
+ raise RuntimeError('Not Implemented on ' + self.__class__.__name__ + ': getDirectoryUrl.')
def getUrl(self,object,documentName=None,extn=None):
- raise RuntimeError, 'Not Implemented on ' + self.__class__.__name__ + ': getUrl.'
+ raise RuntimeError('Not Implemented on ' + self.__class__.__name__ + ': getUrl.')
def getDirectoryUrl(self,object):
return self.rootUrl
def getStateIconInformation(self,statePair):
- raise RuntimeError, 'Not Implemented on ' + self.__class__.__name__ + ': getStateIconInformation.'
+ raise RuntimeError('Not Implemented on ' + self.__class__.__name__ + ': getStateIconInformation.')
def getImageUrl(self,name,depth=0):
- raise RuntimeError, 'Not Implemented on ' + self.__class__.__name__ + ': getIconUrl.'
+ raise RuntimeError('Not Implemented on ' + self.__class__.__name__ + ': getIconUrl.')
def getIconUrl(self,name,depth=0):
- raise RuntimeError, 'Not Implemented on ' + self.__class__.__name__ + ': getImageUrl.'
+ raise RuntimeError('Not Implemented on ' + self.__class__.__name__ + ': getImageUrl.')
Modified: gump/live/python/gump/actor/document/xdocs/documenter.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/actor/document/xdocs/documenter.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/python/gump/actor/document/xdocs/documenter.py (original)
+++ gump/live/python/gump/actor/document/xdocs/documenter.py Mon Nov 30 21:45:38 2020
@@ -21,7 +21,7 @@
"""
import os
-import StringIO
+import io
import sys
import time
@@ -193,7 +193,7 @@ class XDocDocumenter(Documenter):
# Sync over public pages...
copyDirectories(workContents, logContents)
except:
- log.error('--- Failed to sync [' + `objDir` + '] (work->log)',
+ log.error('--- Failed to sync [' + repr(objDir) + '] (work->log)',
exc_info = 1)
success = False
@@ -211,7 +211,7 @@ class XDocDocumenter(Documenter):
# Sync over public pages...
copyDirectories(workContents, logContents)
except:
- log.error('--- Failed to sync xdocs [' + `objDir` + \
+ log.error('--- Failed to sync xdocs [' + repr(objDir) + \
'] (work->log)', exc_info = 1)
success = False
@@ -348,9 +348,9 @@ class XDocDocumenter(Documenter):
'Results':'Generate Results' }
# iterate over this suites properties
- for (name, value) in getBeanAttributes(options).items():
+ for (name, value) in list(getBeanAttributes(options).items()):
desc = name
- if descs.has_key(name):
+ if name in descs:
desc = descs[name] + ' (' + name + ')'
optTable.createEntry(desc, value)
opts += 1
@@ -371,7 +371,7 @@ class XDocDocumenter(Documenter):
envTable = propertiesSection.createTable(['Name/Description', 'Value'])
envs = 0
# iterate over this suites properties
- for (name, value) in getBeanAttributes(environment).items():
+ for (name, value) in list(getBeanAttributes(environment).items()):
envTable.createEntry(name, str(value))
envs += 1
if not envs:
@@ -486,7 +486,7 @@ class XDocDocumenter(Documenter):
spec.getFile(),
self.config,
spec.getRootPath())
- stream = StringIO.StringIO()
+ stream = io.StringIO()
texter = TextDocumenter(self.run, stream)
texter.document()
stream.seek(0)
@@ -501,10 +501,10 @@ class XDocDocumenter(Documenter):
spec.getFile(),
self.config,
spec.getRootPath())
- stream = StringIO.StringIO()
+ stream = io.StringIO()
try:
self.workspace.dom.writexml(stream, indent = ' ', newl = '\n')
- except Exception, details:
+ except Exception as details:
stream.write('Failed to XML serialize the data. ' \
+ str(details))
stream.seek(0)
@@ -615,15 +615,15 @@ class XDocDocumenter(Documenter):
# Does this self.workspace send notification (nag) mails?
detailsTable.createEntry("Send Notification E-mails: ",
- `self.workspace.isNotify()`)
+ repr(self.workspace.isNotify()))
detailsTable.createEntry("Multi-threading: ",
- `self.workspace.isMultithreading()`)
+ repr(self.workspace.isMultithreading()))
if self.workspace.isMultithreading():
detailsTable.createEntry("Updater Threads: ",
- `self.workspace.getUpdaters()`)
+ repr(self.workspace.getUpdaters()))
detailsTable.createEntry("Builder Threads: ",
- `self.workspace.getBuilders()`)
+ repr(self.workspace.getBuilders()))
#document.createRaw('<p><strong>Context Tree:</strong> ' + \
# '<link href=\'workspace.html\'>workspace' + \
@@ -1504,7 +1504,7 @@ This page helps Gumpmeisters (and others
if repo.hasHostname():
detailList.createEntry('Hostname: ', repo.getHostname())
- detailList.createEntry('Redistributable: ', `repo.isRedistributable()`)
+ detailList.createEntry('Redistributable: ', repr(repo.isRedistributable()))
self.documentXML(document, repo)
@@ -1930,7 +1930,7 @@ This page helps Gumpmeisters (and others
if project.isSpliced():
detailsList.createEntry('Metadata formed from multiple XML ' + \
- 'pieces: ', `project.isSpliced()`)
+ 'pieces: ', repr(project.isSpliced()))
if project.hasHomeDirectory():
detailsList.createEntry('Home Directory: ',
@@ -1949,7 +1949,7 @@ This page helps Gumpmeisters (and others
detailsList.createEntry("Elapsed: ", e)
detailsList.createEntry('Redistributable: ',
- `project.isRedistributable()`)
+ repr(project.isRedistributable()))
# Display nag information
if project.hasNotifys():
@@ -2410,7 +2410,7 @@ This page helps Gumpmeisters (and others
# If we know state on the other server.
statePair = None
utcTime = None
- if serverResults and serverResults.has_key(server):
+ if serverResults and server in serverResults:
results = serverResults[server]
if results:
statePair = results.getStatePair()
@@ -2480,10 +2480,10 @@ This page helps Gumpmeisters (and others
return
xmlSection = xdocNode.createSection('Definition')
- stream = StringIO.StringIO()
+ stream = io.StringIO()
try:
dom.writexml(stream, indent = ' ', newl = '\n')
- except Exception, details:
+ except Exception as details:
stream.write('Failed to XML serialize the data. ' + str(details))
stream.seek(0)
xmldata = stream.read()
@@ -2660,13 +2660,13 @@ This page helps Gumpmeisters (and others
#
if work.command.params:
title = 'Parameter'
- if len(work.command.params.items()) > 1:
+ if len(list(work.command.params.items())) > 1:
title += 's'
parameterSection = wdocument.createSection(title)
parameterTable = parameterSection.createTable(['Prefix',
'Name', 'Value'])
- for param in work.command.params.items():
+ for param in list(work.command.params.items()):
paramRow = parameterTable.createRow()
paramRow.createData(param.prefix or '')
@@ -2686,7 +2686,7 @@ This page helps Gumpmeisters (and others
envSection = wdocument.createSection('Environment Overrides')
envTable = envSection.createTable(['Name', 'Value'])
- for (name, value) in work.command.env.iteritems():
+ for (name, value) in list(work.command.env.items()):
envRow = envTable.createRow()
envRow.createData(name)
if value:
@@ -2776,7 +2776,7 @@ This page helps Gumpmeisters (and others
if o:
o.close()
- except Exception, details:
+ except Exception as details:
outputSection.createParagraph('Failed to copy contents ' + \
'from :' + output + \
' : ' + str(details))
@@ -2909,7 +2909,7 @@ This page helps Gumpmeisters (and others
finally:
if o:
o.close()
- except Exception, details:
+ except Exception as details:
outputSection.createParagraph('Failed to copy ' + \
'contents from :'\
+ output + ' : ' \
@@ -2917,7 +2917,7 @@ This page helps Gumpmeisters (and others
else:
outputSection\
.createParagraph('No contents in this file.')
- except Exception, details:
+ except Exception as details:
fdocument.createWarning('Failed documeting file or ' + \
'directory. %s' % details)
else:
@@ -3657,7 +3657,7 @@ This page helps Gumpmeisters (and others
spec.getRootPath())
repoMap = xref.getRepositoryToModuleMap()
- repoList = createOrderedList(repoMap.keys())
+ repoList = createOrderedList(list(repoMap.keys()))
rcount = 0
if repoList:
for repo in repoList:
@@ -3696,7 +3696,7 @@ This page helps Gumpmeisters (and others
packageTable = document.createTable(['Modules By Package'])
packageMap = xref.getPackageToModuleMap()
- for package in createOrderedList(packageMap.keys()):
+ for package in createOrderedList(list(packageMap.keys())):
moduleList = createOrderedList(packageMap.get(package))
@@ -3733,7 +3733,7 @@ This page helps Gumpmeisters (and others
descriptionTable = document.createTable(['Modules By Description'])
descriptionMap = xref.getDescriptionToModuleMap()
- for description in createOrderedList(descriptionMap.keys()):
+ for description in createOrderedList(list(descriptionMap.keys())):
moduleList = createOrderedList(descriptionMap.get(description))
@@ -3769,7 +3769,7 @@ This page helps Gumpmeisters (and others
packageTable = document.createTable(['Projects By Package'])
packageMap = xref.getPackageToProjectMap()
- for package in createOrderedList(packageMap.keys()):
+ for package in createOrderedList(list(packageMap.keys())):
projectList = createOrderedList(packageMap.get(package))
@@ -3805,7 +3805,7 @@ This page helps Gumpmeisters (and others
descriptionTable = document.createTable(['Projects By Description'])
descriptionMap = xref.getDescriptionToProjectMap()
- for description in createOrderedList(descriptionMap.keys()):
+ for description in createOrderedList(list(descriptionMap.keys())):
projectList = createOrderedList(descriptionMap.get(description))
@@ -3843,7 +3843,7 @@ This page helps Gumpmeisters (and others
'(e.g. Outputs)'])
outputMap = xref.getOutputToProjectMap()
- for output in createOrderedList(outputMap.keys()):
+ for output in createOrderedList(list(outputMap.keys())):
projectList = createOrderedList(outputMap.get(output))
@@ -3879,7 +3879,7 @@ This page helps Gumpmeisters (and others
outputTable = document.createTable(['Projects By Output Identifiers'])
outputMap = xref.getOutputIdToProjectMap()
- for outputId in createOrderedList(outputMap.keys()):
+ for outputId in createOrderedList(list(outputMap.keys())):
projectList = createOrderedList(outputMap.get(outputId))
@@ -3916,7 +3916,7 @@ This page helps Gumpmeisters (and others
'Location'])
descLocnMap = xref.getDescriptorLocationToProjectMap()
- for descLocn in createOrderedList(descLocnMap.keys()):
+ for descLocn in createOrderedList(list(descLocnMap.keys())):
projectList = createOrderedList(descLocnMap.get(descLocn))
Modified: gump/live/python/gump/actor/document/xdocs/resolver.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/actor/document/xdocs/resolver.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/python/gump/actor/document/xdocs/resolver.py (original)
+++ gump/live/python/gump/actor/document/xdocs/resolver.py Mon Nov 30 21:45:38 2020
@@ -25,7 +25,6 @@ import time
import os
import sys
from xml.sax.saxutils import escape
-from string import lower,replace
from gump import log
from gump.core.config import *
@@ -91,9 +90,9 @@ def getPathForObject(object,visited=None
path=getPathForObject(object.getOwner())
else:
dump(visited)
- raise RuntimeError, "Circular visits acquiring path for :" + `object`
+ raise RuntimeError("Circular visits acquiring path for :" + repr(object))
else:
- raise RuntimeError, "Can't acquire path for :" + `object`
+ raise RuntimeError("Can't acquire path for :" + repr(object))
return path
@@ -155,7 +154,7 @@ def getDocumentForObject(object, extn, v
elif isinstance(object, Ownable) :
document=getDocumentForObject(object.getOwner(),extn,visited)
else:
- raise RuntimeError, "Unable to determine document for:" + `object`
+ raise RuntimeError("Unable to determine document for:" + repr(object))
return document
@@ -302,7 +301,7 @@ class XDocResolver(Resolver):
description+=' with reason '+rdesc
# Build the URL to the icon
- iconName=gumpSafeName(lower(replace(sname,' ','_')))
+ iconName=gumpSafeName(sname.replace(' ','_').lower())
url = self.getIconUrl(iconName+'.png',depth)
return (url, description)
Modified: gump/live/python/gump/actor/document/xdocs/xdoc.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/actor/document/xdocs/xdoc.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/python/gump/actor/document/xdocs/xdoc.py (original)
+++ gump/live/python/gump/actor/document/xdocs/xdoc.py Mon Nov 30 21:45:38 2020
@@ -28,7 +28,6 @@ import sys
import logging
import types
-from types import NoneType, TupleType
from xml.sax.saxutils import escape
from gump import log
@@ -44,14 +43,14 @@ while i<=255:
# Allow TAB, LF, CR and 32 .. 128.
if i == 9 or i == 10 or i==13 or (i >= 32 and i < 128):
MAP.append(chr(i))
- UMAP.append(unicode(chr(i)))
+ UMAP.append(str(chr(i)))
else:
# Map others to underscore
MAP.append(chr(95))
- UMAP.append(unicode(chr(95)))
+ UMAP.append(str(chr(95)))
i+=1
STRING_MAP_TABLE=''.join(MAP)
-UNICODE_MAP_TABLE=unicode('').join(UMAP)
+UNICODE_MAP_TABLE=str('').join(UMAP)
class XDocContext:
def __init__(self,stream=None,pretty=False,depth=0):
@@ -61,8 +60,8 @@ class XDocContext:
if stream:
self.stream=stream
else:
- log.debug('Create transient stream ['+`self.depth`+']...')
- self.stream=StringIO.StringIO()
+ log.debug('Create transient stream ['+repr(self.depth)+']...')
+ self.stream=io.StringIO()
def createSubContext(self,transient=False):
if not transient:
@@ -74,8 +73,8 @@ class XDocContext:
def performIO(self,stuff):
try:
self.stream.write(stuff)
- except Exception, details:
- log.error('Failed to write [' + stuff + '] @ ['+`self.depth`+'] : ' + str(details))
+ except Exception as details:
+ log.error('Failed to write [' + stuff + '] @ ['+repr(self.depth)+'] : ' + str(details))
raise
def writeIndented(self,xdoc):
@@ -115,7 +114,7 @@ class XDocContext:
self.performIO(self.map(raw))
def isTransient(self):
- return isinstance(self.stream,StringIO.StringIO)
+ return isinstance(self.stream,io.StringIO)
def writeContext(self,otherContext):
@@ -131,7 +130,7 @@ class XDocContext:
stream.close()
def close(self):
- #if isinstance(self.stream,StringIO.StringIO):
+ #if isinstance(self.stream,io.StringIO):
# self.stream.seek(0)
# print(self.stream.read())
#else:
@@ -139,7 +138,7 @@ class XDocContext:
self.stream.close()
def map(self,raw):
- if isinstance(raw,types.UnicodeType):
+ if isinstance(raw,str):
return escape(raw.translate(UNICODE_MAP_TABLE))
return escape(raw.translate(STRING_MAP_TABLE))
@@ -189,7 +188,7 @@ class XDocPiece:
def middle(self):
if not self.subpieces:
- log.warn('Empty [' + `self` + '] probably isn\'t good...')
+ log.warn('Empty [' + repr(self) + '] probably isn\'t good...')
else:
for sub in self.subpieces:
sub.serialize()
@@ -379,7 +378,7 @@ class XDocList(XDocPiece):
def createEntry(self,title,text=None):
item=self.createItem()
item.createStrong(title)
- if not isinstance(text,NoneType):
+ if text is not None:
item.createText(str(text))
return item
@@ -422,7 +421,7 @@ class XDocTable(XDocPiece):
if headings:
headerRow=self.createRow()
for heading in headings:
- if isinstance(heading,TupleType):
+ if isinstance(heading,tuple):
(title,style)=heading
headerRow.createHeader(title).setStyle(style)
else:
@@ -441,7 +440,7 @@ class XDocTable(XDocPiece):
row=self.createRow()
if isinstance(datum,list):
for data in datum:
- if isinstance(data,TupleType):
+ if isinstance(data,tuple):
(value,style)=data
row.createData(value).setStyle(style)
else:
@@ -454,7 +453,7 @@ class XDocTable(XDocPiece):
def createEntry(self,title,data=None):
row=self.createRow()
titleData=row.createData().createStrong(title)
- if not isinstance(data,NoneType):
+ if data is not None:
dataData=row.createData(str(data))
return row
@@ -500,7 +499,7 @@ class XDocTableHeader(XDocPiece):
class XDocTableData(XDocPiece):
def __init__(self,context,config,text):
XDocPiece.__init__(self,context,config)
- if not isinstance(text,NoneType):
+ if text is not None:
self.createText(str(text))
def start(self):
@@ -653,7 +652,7 @@ class XDocLink(XDocPiece):
class XDocFork(XDocPiece):
def __init__(self,context,config,href,text=None):
XDocPiece.__init__(self,context,config)
- if not href: raise RuntimeError, 'Can not fork with nowhere to go.'
+ if not href: raise RuntimeError('Can not fork with nowhere to go.')
self.href=href
if text:
self.createText(text)
@@ -721,7 +720,7 @@ class XDocRaw(XDocPiece):
class XDocDocument(XDocPiece):
def __init__(self,title,output=None,config=None,rootpath='.'):
- if isinstance(output,types.StringTypes):
+ if isinstance(output,str):
self.xfile=output
#log.debug('Documenting to file : [' + self.xfile + ']')
# Open for writing with a decent sized buffer.
Modified: gump/live/python/gump/actor/mvnrepoproxy/proxycontrol.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/actor/mvnrepoproxy/proxycontrol.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/python/gump/actor/mvnrepoproxy/proxycontrol.py (original)
+++ gump/live/python/gump/actor/mvnrepoproxy/proxycontrol.py Mon Nov 30 21:45:38 2020
@@ -19,7 +19,7 @@ import os
import os.path
import tempfile
import time
-import urllib
+import urllib.request, urllib.parse
from gump import log
from gump.core.model.output import OUTPUT_POM
@@ -97,8 +97,8 @@ class MvnRepositoryProxyController(Abstr
self.saveLogAndStop()
def publish(self, groupId, artifactId, fileName):
- urllib.urlopen(self.proxyURL + 'addartifact',
- urllib.urlencode({'groupId': groupId,
+ urllib.request.urlopen(self.proxyURL + 'addartifact',
+ urllib.parse.urlencode({'groupId': groupId,
'artifactId': artifactId,
'file': fileName}))
@@ -127,7 +127,7 @@ class MvnRepositoryProxyController(Abstr
# Hang back for a bit while the proxy starts up
for _pWait in range(10):
try:
- urllib.urlopen(self.proxyURL)
+ urllib.request.urlopen(self.proxyURL)
# Not reached until urlopen succeeds
log.info('mvn Repository proxy started')
break
@@ -143,7 +143,7 @@ class MvnRepositoryProxyController(Abstr
log.info('Storing proxyLog to xdocs-work ...')
try:
- proxyLogRequest = urllib.urlopen(self.proxyURL + proxyLogFileName)
+ proxyLogRequest = urllib.request.urlopen(self.proxyURL + proxyLogFileName)
proxyLogContent = proxyLogRequest.read()
proxyLogRequest.close()
# TODO xdocs-Documenter is hard-coded here
@@ -158,7 +158,7 @@ class MvnRepositoryProxyController(Abstr
log.info('Stopping mvn repository proxy')
try:
- urllib.urlopen(self.proxyURL + 'stop', urllib.urlencode({}))
+ urllib.request.urlopen(self.proxyURL + 'stop', urllib.parse.urlencode({}))
# allow Java process to stop before the Python process terminates
time.sleep(5)
except:
Modified: gump/live/python/gump/actor/notify/notification.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/actor/notify/notification.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/python/gump/actor/notify/notification.py (original)
+++ gump/live/python/gump/actor/notify/notification.py Mon Nov 30 21:45:38 2020
@@ -26,9 +26,7 @@ import os
import sys
import logging
import types
-import StringIO
-
-from string import lower, upper, capitalize
+import io
from gump import log
from gump.core.config import *
@@ -95,7 +93,7 @@ class Notification(RunSpecific):
# If not passed, create temporary
if not stream:
- stream=StringIO.StringIO()
+ stream=io.StringIO()
if self.isSuccess():
stream.write('To whom it may satisfy...')
@@ -133,7 +131,7 @@ and/or contact the folk at general@gump.
stream.write('.\n')
# Add State (and reason)
- stream.write('The current state of this %s is \'%s\'' % (lower(type), self.entity.getStateDescription()))
+ stream.write('The current state of this %s is \'%s\'' % (type.lower(), self.entity.getStateDescription()))
if self.entity.hasReason():
stream.write(', with reason \'' + self.entity.getReasonDescription() + '\'')
stream.write('.\n')
@@ -188,7 +186,7 @@ and/or contact the folk at general@gump.
# If passed (or created) a StringIO, return String
# containing contents.
- if isinstance(stream,StringIO.StringIO):
+ if isinstance(stream,io.StringIO):
stream.seek(0)
return stream.read()
@@ -208,7 +206,7 @@ and/or contact the folk at general@gump.
stream.write("The following annotations (debug/informational/warning/error messages) were provided:")
stream.write("\n")
for note in self.entity.annotations:
- stream.write(' -%s- %s\n' % (upper(levelName(note.level)), note.text))
+ stream.write(' -%s- %s\n' % (levelName(note.level).upper(), note.text))
stream.write("\n")
def resolveWork(self, resolver, stream):
Modified: gump/live/python/gump/actor/notify/notifier.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/actor/notify/notifier.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/python/gump/actor/notify/notifier.py (original)
+++ gump/live/python/gump/actor/notify/notifier.py Mon Nov 30 21:45:38 2020
@@ -26,8 +26,6 @@ import os
import sys
import logging
-from string import lower, capitalize
-
from gump import log
from gump.core.config import *
from gump.core.run.gumprun import *
@@ -139,7 +137,7 @@ class Notifier(AbstractRunActor):
self.notifyModule(module,notification)
- except Exception, details:
+ except Exception as details:
log.error("Failed to send notify e-mails for module " + module.getName()\
+ " : " + str(details), exc_info=1)
@@ -154,7 +152,7 @@ class Notifier(AbstractRunActor):
log.info('Notify for project: ' + project.getName())
self.notifyProject(project,notification)
- except Exception, details:
+ except Exception as details:
log.error("Failed to send notify e-mails for project " + project.getName()\
+ " : " + str(details), exc_info=1)
@@ -226,7 +224,7 @@ class Notifier(AbstractRunActor):
The following %s notify%s should have been sent
-""" % (`count`, plural)
+""" % (repr(count), plural)
content += SEPARATOR
content += '\n'
@@ -274,7 +272,7 @@ The following %s notify%s should have be
# Form the subject
subject=self.workspace.prefix+ \
': Module '+module.getName()+' '+ \
- lower(stateDescription(module.getState()))
+ stateDescription(module.getState()).lower()
if notification.isWarning():
subject += ', but with warnings.'
@@ -294,7 +292,7 @@ The following %s notify%s should have be
# Form the subject
subject=self.workspace.prefix+': Project '+ project.getName() \
+ ' (in module ' + module.getName() + ') ' \
- + lower(stateDescription(project.getState()))
+ + stateDescription(project.getState()).lower()
if notification.isWarning():
subject += ', but with warnings.'
@@ -371,7 +369,7 @@ The following %s notify%s should have be
self.workspace.mailserver,
self.workspace.mailport)
- except Exception, details:
+ except Exception as details:
sent=False
log.error('Failed to send notify e-mail: ' + str(details), exc_info=1)
Modified: gump/live/python/gump/actor/repository/artifact.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/actor/repository/artifact.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/python/gump/actor/repository/artifact.py (original)
+++ gump/live/python/gump/actor/repository/artifact.py Mon Nov 30 21:45:38 2020
@@ -99,8 +99,8 @@ class ArtifactRepository:
for file in os.listdir(gdir):
match=ArtifactRepository.ARTIFACT_RE.match(file)
- if match and not match.group(1) in recent.keys():
- print 'remove : ' + file
+ if match and not match.group(1) in list(recent.keys()):
+ print('remove : ' + file)
def publish(self,group,artifact,id=None):
"""
@@ -155,7 +155,7 @@ class ArtifactRepository:
extn=match.group(3)
# Group by date
- if not dates.has_key(date):
+ if date not in dates:
dates[date]={}
dates[date][id]=(id,date,extn,match.group(0))
Modified: gump/live/python/gump/actor/repository/publisher.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/actor/repository/publisher.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/python/gump/actor/repository/publisher.py (original)
+++ gump/live/python/gump/actor/repository/publisher.py Mon Nov 30 21:45:38 2020
@@ -59,7 +59,7 @@ class RepositoryPublisher(gump.core.run.
try:
# Publish licenses
self.repository.publish( groupName, licensePath )
- except Exception, details:
+ except Exception as details:
message='Failed to publish license [' + licensePath + '] to repository : ' + str(details)
project.addError(message)
log.error(message)
@@ -71,7 +71,7 @@ class RepositoryPublisher(gump.core.run.
try:
# Publish under artifact identifier...
self.repository.publish( groupName, outputPath, output.getId())
- except Exception, details:
+ except Exception as details:
message='Failed to publish [' + outputPath + '] to repository : ' + str(details)
project.addError(message)
log.error(message)
Modified: gump/live/python/gump/actor/results/loader.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/actor/results/loader.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/python/gump/actor/results/loader.py (original)
+++ gump/live/python/gump/actor/results/loader.py Mon Nov 30 21:45:38 2020
@@ -51,7 +51,7 @@ class WorkspaceResultLoader:
if not os.path.exists(file):
log.error('WorkspaceResult metadata file ['+file+'] not found')
- raise IOError, """WorkspaceResult %s not found!""" % file
+ raise IOError("""WorkspaceResult %s not found!""" % file)
log.debug("Launch DOM Parser onto : " + file);
Modified: gump/live/python/gump/actor/results/model.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/actor/results/model.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/python/gump/actor/results/model.py (original)
+++ gump/live/python/gump/actor/results/model.py Mon Nov 30 21:45:38 2020
@@ -23,7 +23,6 @@
"""
from time import localtime, strftime, tzname
-from string import lower, capitalize
from xml.dom import getDOMImplementation
from gump.util.note import *
@@ -183,10 +182,10 @@ class ResultsSet(dict):
if self.calculated: return self.differences
lastPair=None
- for result in self.values():
+ for result in list(self.values()):
statePair=result.getStatePair()
if lastPair:
- if lastPair <> statePair:
+ if lastPair != statePair:
self.differences=1
lastPair=statePair
@@ -197,7 +196,7 @@ class ResultsSet(dict):
return self.containsState(STATE_FAILED)
def containsState(self,state):
- for result in self.values():
+ for result in list(self.values()):
if state == result.getState():
return 1
return 0
@@ -225,18 +224,18 @@ class WorkspaceResult(ResultModelObject)
# Lists...
#
def hasModuleResults(self):
- if self.moduleResults.values(): return True
+ if list(self.moduleResults.values()): return True
return False
def getModuleResults(self):
- return self.moduleResults.values()
+ return list(self.moduleResults.values())
def hasProjectResults(self):
- if self.projectResults.values(): return True
+ if list(self.projectResults.values()): return True
return False
def getProjectResults(self):
- return self.projectResults.values()
+ return list(self.projectResults.values())
#
# Named...
@@ -284,7 +283,7 @@ class WorkspaceResult(ResultModelObject)
topElement.setAttribute('tzone',self.getTimezone())
topElement.setAttribute('tzoneOffset',self.getTimezoneOffset())
- for moduleResult in self.moduleResults.values():
+ for moduleResult in list(self.moduleResults.values()):
moduleResult.createDom(self.dom,topElement)
def complete(self):
@@ -318,7 +317,7 @@ class WorkspaceResult(ResultModelObject)
""" Display the contents of this object """
ResultModelObject.dump(self,indent,output)
- for moduleResult in self.moduleResults.values():
+ for moduleResult in list(self.moduleResults.values()):
moduleResult.dump(indent+1, output)
# represents a <moduleResult/> element
@@ -337,11 +336,11 @@ class ModuleResult(ResultModelObject):
projectResult.setOwner(self)
def hasProjectResults(self):
- if self.projectResults.values(): return 1
+ if list(self.projectResults.values()): return 1
return 0
def getProjectResults(self):
- return self.projectResults.values()
+ return list(self.projectResults.values())
def createDom(self, document, element):
if self.hasDom(): return
@@ -373,7 +372,7 @@ class ModuleResult(ResultModelObject):
""" Display the contents of this object """
ResultModelObject.dump(self,indent,output)
- for projectResult in self.projectResults.values():
+ for projectResult in list(self.projectResults.values()):
projectResult.dump(indent+1, output)
# represents a <projectResult/> element
Modified: gump/live/python/gump/actor/results/resulter.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/actor/results/resulter.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/python/gump/actor/results/resulter.py (original)
+++ gump/live/python/gump/actor/results/resulter.py Mon Nov 30 21:45:38 2020
@@ -28,8 +28,6 @@ import os
import sys
import logging
-from string import lower, capitalize
-
from gump import log
from gump.core.run.actor import *
@@ -71,7 +69,7 @@ class Resulter(AbstractRunActor):
def getServerResultFor(self, server, object):
results=self.getResultsForAllServers(object)
- if results.has_key(server):
+ if server in results:
return results[server]
def getResultsForAllServers(self, object):
@@ -84,7 +82,7 @@ class Resulter(AbstractRunActor):
# For all servers, extract any result
for server in self.workspace.getServers():
result=None
- if self.serverResults.has_key(server):
+ if server in self.serverResults:
serverResults=self.serverResults[server]
if isinstance(object,NamedModelObject):
name=object.getName()
@@ -114,7 +112,7 @@ class Resulter(AbstractRunActor):
try:
if server.isPython():
results=self.loadResultsForServer(server)
- except Exception, details:
+ except Exception as details:
log.debug('Failed to load results for [' + str(server) + '] : ' \
+ str(details), exc_info=1)
@@ -191,7 +189,7 @@ class Resulter(AbstractRunActor):
# Take just one string for each.
(workspaceResults.timezone, dst)=self.run.getEnvironment().getTimezone()
- workspaceResults.timezoneOffset=`self.run.getEnvironment().getTimezoneOffset()`
+ workspaceResults.timezoneOffset=repr(self.run.getEnvironment().getTimezoneOffset())
# For all modules...
for module in self.workspace.getModules():
Modified: gump/live/python/gump/actor/stats/dbm/statsdb.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/actor/stats/dbm/statsdb.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/python/gump/actor/stats/dbm/statsdb.py (original)
+++ gump/live/python/gump/actor/stats/dbm/statsdb.py Mon Nov 30 21:45:38 2020
@@ -22,7 +22,7 @@ import datetime
import os
import sys
import logging
-import anydbm
+import dbm
from gump import log
from gump.core.config import *
@@ -33,7 +33,15 @@ from gump.core.model.workspace import Wo
from gump.core.model.state import *
from gump.tool.shared.comparator import *
-
+
+class MockDB(dict):
+ """
+ Mock Database
+ """
+
+ def __init(self):
+ pass
+
class StatisticsDB:
"""
Statistics Database Interface
@@ -50,9 +58,9 @@ class StatisticsDB:
# Unfortuantely Python on M$ does not have an implementation (yet)
log.debug('Open Statistic Database:' + self.dbpath)
if not os.name == 'dos' and not os.name == 'nt':
- self.db = anydbm.open(self.dbpath,'c')
+ self.db=dbm.open(self.dbpath,'c')
else:
- self.db={}
+ self.db=MockDB()
# Workspace
@@ -184,13 +192,13 @@ class StatisticsDB:
def _get(self,key):
key=str(key)
val=''
- if self.db.has_key(key): val=str(self.db[key])
+ if key in self.db: val=self.db[key].decode(encoding="utf-8")
return val
def _getInt(self,key):
key=str(key)
val=0
- if self.db.has_key(key): val=int(self.db[key])
+ if key in self.db: val=int(self.db[key])
return val
def _getFloat(self,key):
@@ -199,7 +207,7 @@ class StatisticsDB:
"""
key=str(key)
val=0.0
- if self.db.has_key(key): val=float(self.db[key])
+ if key in self.db: val=float(self.db[key])
return val
def _getDate(self,key):
@@ -209,7 +217,7 @@ class StatisticsDB:
dateF=self._get(key)
if dateF:
- #print 'dateF ' + dateF
+ #print('dateF ' + dateF)
if not ' ' in dateF:
# Historical float perhaps?
date=datetime.datetime.utcfromtimestamp(int(dateF))
Modified: gump/live/python/gump/actor/stats/mysql/statsdb.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/actor/stats/mysql/statsdb.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/python/gump/actor/stats/mysql/statsdb.py (original)
+++ gump/live/python/gump/actor/stats/mysql/statsdb.py Mon Nov 30 21:45:38 2020
@@ -144,7 +144,7 @@ class StatisticsDB:
moduleName, stats)
# Extract that extra
- if settings.has_key('last_modified') and settings['last_modified']:
+ if 'last_modified' in settings and settings['last_modified']:
value = settings['last_modified']
if isinstance(value, datetime.datetime):
stats.lastModified = value
@@ -212,7 +212,7 @@ class StatisticsDB:
Extract values by name from the DB row
"""
for (attr, column) in StatisticsDB.ATTR_COLUMN_MAP.items():
- if settings.has_key(column) and settings[column]:
+ if column in settings and settings[column]:
if hasattr(stats, attr):
value = settings[column]
@@ -249,7 +249,7 @@ class StatisticsDB:
#print "SET ATTR : " + `value`
settings[column] = "'" +\
value.strftime('%Y-%m-%d %H:%M:%S') + "'"
- elif isinstance(value, types.StringTypes):
+ elif isinstance(value, basestring):
settings[column] = "'" + str(value) + "'"
else:
settings[column] = str(value)
@@ -289,7 +289,7 @@ if __name__ == '__main__':
stats.putProjectStats(ps)
if len(sys.argv) > 1:
stats.delProjectStats(ps)
- print "Project"
+ print ("Project")
ps.dump()
sys.exit()
@@ -300,7 +300,7 @@ if __name__ == '__main__':
stats.putWorkspaceStats(ws)
if len(sys.argv) > 1:
stats.delWorkspaceStats(ws)
- print "Workspace"
+ print ("Workspace")
ws.dump()
# Module
@@ -309,7 +309,7 @@ if __name__ == '__main__':
stats.putModuleStats(ms)
if len(sys.argv) > 1:
stats.delModuleStats(ms)
- print "Module"
+ print ("Module")
ms.dump()
# Repository
@@ -318,6 +318,6 @@ if __name__ == '__main__':
stats.putRepositoryStats(rs)
if len(sys.argv) > 1:
stats.delRepositoryStats(rs)
- print "Repository"
+ print ("Repository")
rs.dump()
Modified: gump/live/python/gump/actor/stats/statistician.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/actor/stats/statistician.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/python/gump/actor/stats/statistician.py (original)
+++ gump/live/python/gump/actor/stats/statistician.py Mon Nov 30 21:45:38 2020
@@ -42,7 +42,7 @@ class Statistician(AbstractRunActor):
# Figure out what DB this workspace uses
dbInfo=self.run.getWorkspace().getDatabaseInformation()
self.db=gump.actor.stats.mysql.statsdb.StatisticsDB(dbInfo)
- except Exception, details:
+ except Exception as details:
log.error('Failed to load MySQL database driver : %s' % (details), exc_info=1)
if not self.db:
@@ -167,7 +167,7 @@ class Statistician(AbstractRunActor):
Show all that is there
"""
for key in self.db.getProjects():
- print "Project " + pname + " Key " + key
+ print("Project " + pname + " Key " + key)
s=self.getProjectStats(pname)
dump(s)
Modified: gump/live/python/gump/actor/syndication/abstract.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/actor/syndication/abstract.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/python/gump/actor/syndication/abstract.py (original)
+++ gump/live/python/gump/actor/syndication/abstract.py Mon Nov 30 21:45:38 2020
@@ -39,24 +39,24 @@ class AbstractSyndicator(RunSpecific):
# Call a method called 'prepareRun(run)'
def prepare(self):
if not hasattr(self,'prepareRun'):
- raise RuntimeError, 'Complete [' + `self.__class__` + '] with prepareRun(self)'
+ raise RuntimeError('Complete [' + repr(self.__class__) + '] with prepareRun(self)')
if not callable(self.prepareRun):
- raise RuntimeException, 'Complete [' + `self.__class__` + '] with a callable prepareRun()'
+ raise RuntimeException('Complete [' + repr(self.__class__) + '] with a callable prepareRun()')
- log.info('Syndicate run using [' + `self` + ']')
+ log.info('Syndicate run using [' + repr(self) + ']')
self.prepareRun()
# Call a method called 'completeRun(run)'
def complete(self):
if not hasattr(self,'completeRun'):
- raise RuntimeError, 'Complete [' + `self.__class__` + '] with completeRun(self)'
+ raise RuntimeError('Complete [' + repr(self.__class__) + '] with completeRun(self)')
if not callable(self.completeRun):
- raise RuntimeException, 'Complete [' + `self.__class__` + '] with a callable completeRun()'
+ raise RuntimeException('Complete [' + repr(self.__class__) + '] with a callable completeRun()')
- log.info('Syndicate run using [' + `self` + ']')
+ log.info('Syndicate run using [' + repr(self) + ']')
self.completeRun()
@@ -74,7 +74,7 @@ class AbstractSyndicator(RunSpecific):
content += self.getStateContent(project.getStatePair(), getDepthForObject(project))
- content += 'Duration in state: <b>' + `stats.sequenceInState` + '</b> (runs) '
+ content += 'Duration in state: <b>' + repr(stats.sequenceInState) + '</b> (runs) '
if not stats.previousState == STATE_NONE \
and not stats.previousState == STATE_UNSET:
@@ -108,7 +108,7 @@ class AbstractSyndicator(RunSpecific):
content += self.getStateContent(module.getStatePair(), getDepthForObject(module))
- content += 'Duration in state: <b>' + `stats.sequenceInState` + '</b> (runs)'
+ content += 'Duration in state: <b>' + repr(stats.sequenceInState) + '</b> (runs)'
if not stats.previousState == STATE_NONE \
and not stats.previousState == STATE_UNSET:
Modified: gump/live/python/gump/actor/syndication/syndicator.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/actor/syndication/syndicator.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/python/gump/actor/syndication/syndicator.py (original)
+++ gump/live/python/gump/actor/syndication/syndicator.py Mon Nov 30 21:45:38 2020
@@ -24,8 +24,6 @@ import os
import sys
import logging
-from string import lower, capitalize
-
from gump import log
from gump.core.run.gumprun import *
from gump.core.run.actor import AbstractRunActor
Modified: gump/live/python/gump/core/build/basebuilder.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/core/build/basebuilder.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/python/gump/core/build/basebuilder.py (original)
+++ gump/live/python/gump/core/build/basebuilder.py Mon Nov 30 21:45:38 2020
@@ -90,7 +90,7 @@ class BaseBuilder(RunSpecific):
"""
Build the project using the configured command.
"""
- log.info('Run ' + self.name + ' on Project: #[' + `project.getPosition()` + \
+ log.info('Run ' + self.name + ' on Project: #[' + repr(project.getPosition()) + \
'] : ' + project.getName())
self.pre_build(project, language, stats)
Modified: gump/live/python/gump/core/build/builder.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/core/build/builder.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/python/gump/core/build/builder.py (original)
+++ gump/live/python/gump/core/build/builder.py Mon Nov 30 21:45:38 2020
@@ -105,7 +105,7 @@ class GumpBuilder(gump.core.run.gumprun.
workspace=self.run.getWorkspace()
- log.info('Build Project: #[' + `project.getPosition()` + '] : ' + project.getName() + ' : [state:' \
+ log.info('Build Project: #[' + repr(project.getPosition()) + '] : ' + project.getName() + ' : [state:' \
+ project.getStateDescription() + ']')
languageHelper=self.run.getLanguageHelper(project.getLanguageType())
@@ -123,7 +123,7 @@ class GumpBuilder(gump.core.run.gumprun.
self.performPreBuild(project, languageHelper, stats)
if project.okToPerformWork():
- log.debug('Performing Build Upon: [' + `project.getPosition()` + '] ' + project.getName())
+ log.debug('Performing Build Upon: [' + repr(project.getPosition()) + '] ' + project.getName())
#if project.isPrereqFailed():
# project.addWarning('Building despite certain prerequisite failures [repository build].')
@@ -170,7 +170,7 @@ class GumpBuilder(gump.core.run.gumprun.
self.extractFromRepository(project, languageHelper)
if project.isFailed():
- log.warn('Failed to build project #[' + `project.getPosition()` + '] : [' + project.getName() + '], state:' \
+ log.warn('Failed to build project #[' + repr(project.getPosition()) + '] : [' + project.getName() + '], state:' \
+ project.getStateDescription())
def performDelete(self,project,delete,index=0):
@@ -244,8 +244,8 @@ class GumpBuilder(gump.core.run.gumprun.
self.performDelete(project,delete,dels)
dels+=1
project.changeState(STATE_SUCCESS)
- except Exception, details:
- message='Failed to perform delete ' + `delete` + ':' + str(details)
+ except Exception as details:
+ message='Failed to perform delete ' + repr(delete) + ':' + str(details)
log.error(message, exc_info=1)
project.addError(message)
project.changeState(STATE_FAILED,REASON_PREBUILD_FAILED)
@@ -258,8 +258,8 @@ class GumpBuilder(gump.core.run.gumprun.
self.performMkDir(project,mkdir,mkdirs)
mkdirs+=1
project.changeState(STATE_SUCCESS)
- except Exception, details:
- message='Failed to perform mkdir ' + `mkdir` + ':' + str(details)
+ except Exception as details:
+ message='Failed to perform mkdir ' + repr(mkdir) + ':' + str(details)
log.error(message, exc_info=1)
project.addError(message)
project.changeState(STATE_FAILED,REASON_PREBUILD_FAILED)
@@ -459,7 +459,7 @@ class GumpBuilder(gump.core.run.gumprun.
id = output.getId()
# Use the repository one...
- if artifacts.has_key(id):
+ if id in artifacts:
(aid,date,extn,path)=artifacts[id]
log.info('Utilize %s from Gump artifact repository for id: %s' % (path, id))
@@ -468,7 +468,7 @@ class GumpBuilder(gump.core.run.gumprun.
output.setPath(path)
else:
log.info('Failed to find artifact for id %s (Gump Repo has %s in %s)' % \
- (id, artifacts.keys(), group))
+ (id, list(artifacts.keys()), group))
artifactsOk=False
break
@@ -491,7 +491,7 @@ class GumpBuilder(gump.core.run.gumprun.
stats=project.getStats()
if project.isPackaged():
- print 'Packaged project: ' + project.getName()
+ print('Packaged project: ' + project.getName())
# Pick your poison..
if project.hasScript():
@@ -511,4 +511,4 @@ class GumpBuilder(gump.core.run.gumprun.
elif project.hasGradle():
self.gradle.preview(project, languageHelper, stats);
else:
- print 'No builder for project: ' + project.getName()
+ print('No builder for project: ' + project.getName())
Modified: gump/live/python/gump/core/build/gradle.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/core/build/gradle.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/python/gump/core/build/gradle.py (original)
+++ gump/live/python/gump/core/build/gradle.py Mon Nov 30 21:45:38 2020
@@ -230,7 +230,7 @@ class GradleBuilder(BaseBuilder):
cmd = get_gradle_command(project)
if cmd:
jvmargs = language.getJVMArgs(project)
- if jvmargs and len(jvmargs.items()) > 0:
+ if jvmargs and len(list(jvmargs.items())) > 0:
cmd.addEnvironment('GRADLE_OPTS', jvmargs.formatCommandLine())
return cmd
@@ -251,7 +251,7 @@ class GradleBuilder(BaseBuilder):
log.error('Display Init Script [ ' + init_script + \
'] Failed', exc_info=1)
- except Exception, details:
+ except Exception as details:
message = 'Generate Gradle Init Script Failed:' + str(details)
log.error(message, exc_info=1)
project.addError(message)
Modified: gump/live/python/gump/core/build/maven.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/core/build/maven.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/python/gump/core/build/maven.py (original)
+++ gump/live/python/gump/core/build/maven.py Mon Nov 30 21:45:38 2020
@@ -175,7 +175,7 @@ class Maven1Builder(BaseBuilder):
cmd = get_maven_command(project)
if cmd:
jvmargs = language.getJVMArgs(project)
- if jvmargs and len(jvmargs.items()) > 0:
+ if jvmargs and len(list(jvmargs.items())) > 0:
cmd.addEnvironment('MAVEN_OPTS', jvmargs.formatCommandLine())
return cmd
@@ -197,7 +197,7 @@ class Maven1Builder(BaseBuilder):
log.error('Display Properties [ ' + props_file + \
'] Failed', exc_info=1)
- except Exception, details:
+ except Exception as details:
message = 'Generate Maven Properties Failed:' + str(details)
log.error(message, exc_info=1)
project.addError(message)
Modified: gump/live/python/gump/core/build/mvn.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/core/build/mvn.py?rev=1883964&r1=1883963&r2=1883964&view=diff
==============================================================================
--- gump/live/python/gump/core/build/mvn.py (original)
+++ gump/live/python/gump/core/build/mvn.py Mon Nov 30 21:45:38 2020
@@ -133,7 +133,7 @@ class MavenBuilder(BaseBuilder):
if cmd:
# Get/set JVM properties
jvmargs = language.getJVMArgs(project)
- if jvmargs and len(jvmargs.items()) > 0:
+ if jvmargs and len(list(jvmargs.items())) > 0:
cmd.addEnvironment('MAVEN_OPTS', jvmargs.formatCommandLine())
return cmd
@@ -150,7 +150,7 @@ class MavenBuilder(BaseBuilder):
log.error('Display Settings [ ' + settings + \
'] Failed', exc_info=1)
- except Exception, details:
+ except Exception as details:
message = 'Generate Maven Settings Failed:' + str(details)
log.error(message, exc_info=1)
project.addError(message)