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/29 00:59:45 UTC
svn commit: r1883919 [1/3] - in /gump/branches/python3:
python/gump/actor/document/ python/gump/actor/document/text/
python/gump/actor/document/xdocs/ python/gump/actor/notify/
python/gump/actor/repository/ python/gump/actor/results/
python/gump/actor/...
Author: ajack
Date: Sun Nov 29 00:59:43 2020
New Revision: 1883919
URL: http://svn.apache.org/viewvc?rev=1883919&view=rev
Log:
Updating to python 3 (from python 2)
Modified:
gump/branches/python3/python/gump/actor/document/documenter.py
gump/branches/python3/python/gump/actor/document/resolver.py
gump/branches/python3/python/gump/actor/document/text/documenter.py
gump/branches/python3/python/gump/actor/document/text/resolver.py
gump/branches/python3/python/gump/actor/document/xdocs/documenter.py
gump/branches/python3/python/gump/actor/document/xdocs/resolver.py
gump/branches/python3/python/gump/actor/document/xdocs/xdoc.py
gump/branches/python3/python/gump/actor/notify/notification.py
gump/branches/python3/python/gump/actor/notify/notifier.py
gump/branches/python3/python/gump/actor/repository/artifact.py
gump/branches/python3/python/gump/actor/repository/publisher.py
gump/branches/python3/python/gump/actor/results/loader.py
gump/branches/python3/python/gump/actor/results/model.py
gump/branches/python3/python/gump/actor/results/resulter.py
gump/branches/python3/python/gump/actor/stats/dbm/statsdb.py
gump/branches/python3/python/gump/actor/stats/statistician.py
gump/branches/python3/python/gump/actor/syndication/abstract.py
gump/branches/python3/python/gump/core/build/basebuilder.py
gump/branches/python3/python/gump/core/build/builder.py
gump/branches/python3/python/gump/core/build/gradle.py
gump/branches/python3/python/gump/core/build/maven.py
gump/branches/python3/python/gump/core/build/mvn.py
gump/branches/python3/python/gump/core/commandLine.py
gump/branches/python3/python/gump/core/config.py
gump/branches/python3/python/gump/core/language/java.py
gump/branches/python3/python/gump/core/language/path.py
gump/branches/python3/python/gump/core/loader/loader.py
gump/branches/python3/python/gump/core/model/builder.py
gump/branches/python3/python/gump/core/model/depend.py
gump/branches/python3/python/gump/core/model/misc.py
gump/branches/python3/python/gump/core/model/module.py
gump/branches/python3/python/gump/core/model/object.py
gump/branches/python3/python/gump/core/model/profile.py
gump/branches/python3/python/gump/core/model/project.py
gump/branches/python3/python/gump/core/model/propagation.py
gump/branches/python3/python/gump/core/model/property.py
gump/branches/python3/python/gump/core/model/repository.py
gump/branches/python3/python/gump/core/model/server.py
gump/branches/python3/python/gump/core/model/stats.py
gump/branches/python3/python/gump/core/model/workspace.py
gump/branches/python3/python/gump/core/run/actor.py
gump/branches/python3/python/gump/core/run/gumpenv.py
gump/branches/python3/python/gump/core/run/gumprun.py
gump/branches/python3/python/gump/core/run/gumpset.py
gump/branches/python3/python/gump/core/update/scmupdater.py
gump/branches/python3/python/gump/core/update/updater.py
gump/branches/python3/python/gump/test/artifacts.py
gump/branches/python3/python/gump/test/describer.py
gump/branches/python3/python/gump/test/diagram.py
gump/branches/python3/python/gump/test/documenter.py
gump/branches/python3/python/gump/test/integrator.py
gump/branches/python3/python/gump/test/language.py
gump/branches/python3/python/gump/test/loading.py
gump/branches/python3/python/gump/test/maven.py
gump/branches/python3/python/gump/test/mockobjects.py
gump/branches/python3/python/gump/test/model.py
gump/branches/python3/python/gump/test/nant.py
gump/branches/python3/python/gump/test/notifying.py
gump/branches/python3/python/gump/test/pyunit.py
gump/branches/python3/python/gump/test/resolving.py
gump/branches/python3/python/gump/test/stats.py
gump/branches/python3/python/gump/test/svg.py
gump/branches/python3/python/gump/test/sync.py
gump/branches/python3/python/gump/test/syndicator.py
gump/branches/python3/python/gump/test/testExample.py
gump/branches/python3/python/gump/test/threads.py
gump/branches/python3/python/gump/test/timing.py
gump/branches/python3/python/gump/test/unicode.py
gump/branches/python3/python/gump/test/updater.py
gump/branches/python3/python/gump/test/utils.py
gump/branches/python3/python/gump/test/xdocs.py
gump/branches/python3/python/gump/test/xref.py
gump/branches/python3/python/gump/tool/guru/xref.py
gump/branches/python3/python/gump/tool/integration/cvs.py
gump/branches/python3/python/gump/tool/performance/deps.py
gump/branches/python3/python/gump/tool/performance/gurus.py
gump/branches/python3/python/gump/tool/performance/xdocs.py
gump/branches/python3/python/gump/tool/shared/comparator.py
gump/branches/python3/python/gump/tool/svg/depdiag.py
gump/branches/python3/python/gump/tool/svg/drawing.py
gump/branches/python3/python/gump/tool/svg/svg.py
gump/branches/python3/python/gump/util/__init__.py
gump/branches/python3/python/gump/util/domutils.py
gump/branches/python3/python/gump/util/file.py
gump/branches/python3/python/gump/util/http.py
gump/branches/python3/python/gump/util/locks.py
gump/branches/python3/python/gump/util/mysql.py
gump/branches/python3/python/gump/util/owner.py
gump/branches/python3/python/gump/util/process/command.py
gump/branches/python3/python/gump/util/process/launcher.py
gump/branches/python3/python/gump/util/smtp.py
gump/branches/python3/python/gump/util/sync.py
gump/branches/python3/python/gump/util/tasks.py
gump/branches/python3/python/gump/util/threads/tools.py
gump/branches/python3/python/gump/util/timing.py
gump/branches/python3/python/gump/util/tools.py
gump/branches/python3/python/gump/util/work.py
gump/branches/python3/python/misc/pgrp.py
gump/branches/python3/python/tool/commitCheck.py
gump/branches/python3/python/tool/profileResults.py
gump/branches/python3/test/gumptest.sh
Modified: gump/branches/python3/python/gump/actor/document/documenter.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/actor/document/documenter.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/actor/document/documenter.py (original)
+++ gump/branches/python3/python/gump/actor/document/documenter.py Sun Nov 29 00:59:43 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/branches/python3/python/gump/actor/document/resolver.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/actor/document/resolver.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/actor/document/resolver.py (original)
+++ gump/branches/python3/python/gump/actor/document/resolver.py Sun Nov 29 00:59:43 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/branches/python3/python/gump/actor/document/text/documenter.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/actor/document/text/documenter.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/actor/document/text/documenter.py (original)
+++ gump/branches/python3/python/gump/actor/document/text/documenter.py Sun Nov 29 00:59:43 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/branches/python3/python/gump/actor/document/text/resolver.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/actor/document/text/resolver.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/actor/document/text/resolver.py (original)
+++ gump/branches/python3/python/gump/actor/document/text/resolver.py Sun Nov 29 00:59:43 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/branches/python3/python/gump/actor/document/xdocs/documenter.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/actor/document/xdocs/documenter.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/actor/document/xdocs/documenter.py (original)
+++ gump/branches/python3/python/gump/actor/document/xdocs/documenter.py Sun Nov 29 00:59:43 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/branches/python3/python/gump/actor/document/xdocs/resolver.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/actor/document/xdocs/resolver.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/actor/document/xdocs/resolver.py (original)
+++ gump/branches/python3/python/gump/actor/document/xdocs/resolver.py Sun Nov 29 00:59:43 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/branches/python3/python/gump/actor/document/xdocs/xdoc.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/actor/document/xdocs/xdoc.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/actor/document/xdocs/xdoc.py (original)
+++ gump/branches/python3/python/gump/actor/document/xdocs/xdoc.py Sun Nov 29 00:59:43 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/branches/python3/python/gump/actor/notify/notification.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/actor/notify/notification.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/actor/notify/notification.py (original)
+++ gump/branches/python3/python/gump/actor/notify/notification.py Sun Nov 29 00:59:43 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/branches/python3/python/gump/actor/notify/notifier.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/actor/notify/notifier.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/actor/notify/notifier.py (original)
+++ gump/branches/python3/python/gump/actor/notify/notifier.py Sun Nov 29 00:59:43 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'
@@ -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/branches/python3/python/gump/actor/repository/artifact.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/actor/repository/artifact.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/actor/repository/artifact.py (original)
+++ gump/branches/python3/python/gump/actor/repository/artifact.py Sun Nov 29 00:59:43 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/branches/python3/python/gump/actor/repository/publisher.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/actor/repository/publisher.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/actor/repository/publisher.py (original)
+++ gump/branches/python3/python/gump/actor/repository/publisher.py Sun Nov 29 00:59:43 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/branches/python3/python/gump/actor/results/loader.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/actor/results/loader.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/actor/results/loader.py (original)
+++ gump/branches/python3/python/gump/actor/results/loader.py Sun Nov 29 00:59:43 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/branches/python3/python/gump/actor/results/model.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/actor/results/model.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/actor/results/model.py (original)
+++ gump/branches/python3/python/gump/actor/results/model.py Sun Nov 29 00:59:43 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/branches/python3/python/gump/actor/results/resulter.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/actor/results/resulter.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/actor/results/resulter.py (original)
+++ gump/branches/python3/python/gump/actor/results/resulter.py Sun Nov 29 00:59:43 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/branches/python3/python/gump/actor/stats/dbm/statsdb.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/actor/stats/dbm/statsdb.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/actor/stats/dbm/statsdb.py (original)
+++ gump/branches/python3/python/gump/actor/stats/dbm/statsdb.py Sun Nov 29 00:59:43 2020
@@ -22,7 +22,7 @@ import datetime
import os
import sys
import logging
-import anydbm
+#TEMPORARY import anydbm
from gump import log
from gump.core.config import *
@@ -33,7 +33,18 @@ 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
+
+ def has_key(self,key):
+ return key in self
+
class StatisticsDB:
"""
Statistics Database Interface
@@ -49,10 +60,10 @@ 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')
- else:
- self.db={}
+ #TEMPORARY if not os.name == 'dos' and not os.name == 'nt':
+ # self.db = anydbm.open(self.dbpath,'c')
+ #else:
+ self.db=MockDB()
# Workspace
Modified: gump/branches/python3/python/gump/actor/stats/statistician.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/actor/stats/statistician.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/actor/stats/statistician.py (original)
+++ gump/branches/python3/python/gump/actor/stats/statistician.py Sun Nov 29 00:59:43 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/branches/python3/python/gump/actor/syndication/abstract.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/actor/syndication/abstract.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/actor/syndication/abstract.py (original)
+++ gump/branches/python3/python/gump/actor/syndication/abstract.py Sun Nov 29 00:59:43 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/branches/python3/python/gump/core/build/basebuilder.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/core/build/basebuilder.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/core/build/basebuilder.py (original)
+++ gump/branches/python3/python/gump/core/build/basebuilder.py Sun Nov 29 00:59:43 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/branches/python3/python/gump/core/build/builder.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/core/build/builder.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/core/build/builder.py (original)
+++ gump/branches/python3/python/gump/core/build/builder.py Sun Nov 29 00:59:43 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/branches/python3/python/gump/core/build/gradle.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/core/build/gradle.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/core/build/gradle.py (original)
+++ gump/branches/python3/python/gump/core/build/gradle.py Sun Nov 29 00:59:43 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/branches/python3/python/gump/core/build/maven.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/core/build/maven.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/core/build/maven.py (original)
+++ gump/branches/python3/python/gump/core/build/maven.py Sun Nov 29 00:59:43 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/branches/python3/python/gump/core/build/mvn.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/core/build/mvn.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/core/build/mvn.py (original)
+++ gump/branches/python3/python/gump/core/build/mvn.py Sun Nov 29 00:59:43 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)
Modified: gump/branches/python3/python/gump/core/commandLine.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/core/commandLine.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/core/commandLine.py (original)
+++ gump/branches/python3/python/gump/core/commandLine.py Sun Nov 29 00:59:43 2020
@@ -60,29 +60,29 @@ class CommandLine:
if argv[1] in ['-V','--version']:
sys.exit(0)
elif argv[1] in ['-h','--help']:
- print "command: " , __name__
- print "Usage: python "+__name__+".py -w {workspaceFile} [OPTION] [PROJECT]"
- print
- print "Mandatory arguments to long options are mandatory for short options too."
- print
- print "Startup:"
- print " -V, --version display the version of Apache Gump(TM) and exit."
- print " -h, --help print this help."
- print " -w, --workspace use this workspace for Gump."
- print
- print "General:"
- print " -v, --verbose verbose logging."
- print " -d, --debug debug logging."
- print
- print " Not relevent to all scripts:"
- print " -O, --official Full run, publishing notifications, etc."
- print " -D, --dated Dated log files."
- print " -c, --cache Use local cache (do not download over HTTP)."
- print " -t, --text Use text not xdocs."
- print " -X, --xdocs Output xdocs, not XHTML."
- print
- print "For bug reports use JIRA: http://issues.apache.org/."
- print "For suggestions: <general@gump.apache.org/>."
+ print("command: " , __name__)
+ print("Usage: python "+__name__+".py -w {workspaceFile} [OPTION] [PROJECT]")
+ print()
+ print("Mandatory arguments to long options are mandatory for short options too.")
+ print()
+ print("Startup:")
+ print(" -V, --version display the version of Apache Gump(TM) and exit.")
+ print(" -h, --help print this help.")
+ print(" -w, --workspace use this workspace for Gump.")
+ print()
+ print("General:")
+ print(" -v, --verbose verbose logging.")
+ print(" -d, --debug debug logging.")
+ print()
+ print(" Not relevent to all scripts:")
+ print(" -O, --official Full run, publishing notifications, etc.")
+ print(" -D, --dated Dated log files.")
+ print(" -c, --cache Use local cache (do not download over HTTP).")
+ print(" -t, --text Use text not xdocs.")
+ print(" -X, --xdocs Output xdocs, not XHTML.")
+ print()
+ print("For bug reports use JIRA: http://issues.apache.org/.")
+ print("For suggestions: <general@gump.apache.org/>.")
sys.exit(0)
#
@@ -161,9 +161,9 @@ class CommandLine:
self.args.append(arg)
removers.append(arg)
else:
- print
- print " No project specified, please supply a comma separated list of project expressions or 'all'."
- print " Project wildcards are accepted, e.g. \"jakarta-*\"."
+ print()
+ print(" No project specified, please supply a comma separated list of project expressions or 'all'.")
+ print(" Project wildcards are accepted, e.g. \"jakarta-*\".")
sys.exit(1)
# Remove those used
Modified: gump/branches/python3/python/gump/core/config.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/core/config.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/core/config.py (original)
+++ gump/branches/python3/python/gump/core/config.py Sun Nov 29 00:59:43 2020
@@ -72,7 +72,7 @@ class setting:
UTC_TIME_PRESENTATION_FORMAT='%H:%M:%S (UTC)'
TIMEOUT=60*60 # 60 minutes (in seconds)
- if os.environ.has_key('GUMP_TIMEOUT'):
+ if 'GUMP_TIMEOUT' in os.environ:
TIMEOUT = string.atoi(os.environ['GUMP_TIMEOUT'])
class default:
@@ -133,11 +133,11 @@ def basicConfig():
if __name__ == '__main__':
def dump(section):
- print
- print "---", str(section).split('.')[-1], "---"
+ print()
+ print(("---", str(section).split('.')[-1], "---"))
for attr in __builtins__.dir(section):
if attr == '__module__': continue
- print " ", attr + ":\t" + getattr(section, attr).__repr__()
+ print((" ", attr + ":\t" + getattr(section, attr).__repr__()))
for section in sys.argv[1:] or ('dir','default','setting','switch'):
dump(locals()[section])
Modified: gump/branches/python3/python/gump/core/language/java.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/core/language/java.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/core/language/java.py (original)
+++ gump/branches/python3/python/gump/core/language/java.py Sun Nov 29 00:59:43 2020
@@ -56,11 +56,11 @@ class JavaHelper(gump.core.run.gumprun.R
"""
args = project.jvmargs
- if os.environ.has_key('GUMP_JAVA_ARGS'):
+ if 'GUMP_JAVA_ARGS' in os.environ:
args = gump.util.process.command.Parameters()
for p in os.environ['GUMP_JAVA_ARGS'].split(' '):
args.addParameter(p)
- for p in project.jvmargs.items() :
+ for p in list(project.jvmargs.items()) :
args.addParameterObject(p)
return args
@@ -102,10 +102,10 @@ class JavaHelper(gump.core.run.gumprun.R
# Do this once only... storing it on the context. Not as nice as
# doing it OO (each project context stores its own, but a step..)
#
- if self.classpaths.has_key(project) and \
- self.bootclasspaths.has_key(project) :
+ if project in self.classpaths and \
+ project in self.bootclasspaths :
if debug:
- print "Classpath/Bootclasspath previously resolved..."
+ print("Classpath/Bootclasspath previously resolved...")
return (self.classpaths[project], self.bootclasspaths[project])
# Start with the system classpath (later remove this)
@@ -162,20 +162,20 @@ class JavaHelper(gump.core.run.gumprun.R
if (dependency in visited):
# beneficiary.addInfo("Duplicated dependency [" + str(depend) + "]")
if debug:
- print str(depth) + ") Already Visited : " + str(dependency)
- print str(depth) + ") Previously Visits : "
+ print(str(depth) + ") Already Visited : " + str(dependency))
+ print(str(depth) + ") Previously Visits : ")
for v in visited:
- print str(depth) + ") - " + str(v)
+ print(str(depth) + ") - " + str(v))
return (None, None)
visited.append(dependency)
if debug:
- print str(depth) + ") Perform : " + `dependency`
+ print(str(depth) + ") Perform : " + repr(dependency))
#
- classpath = Classpath('Classpath for ' + `dependency`)
- bootclasspath = Classpath('Bootclasspath for ' + `dependency`)
+ classpath = Classpath('Classpath for ' + repr(dependency))
+ bootclasspath = Classpath('Bootclasspath for ' + repr(dependency))
# Context for this dependecy project...
project = dependency.getProject()
@@ -226,13 +226,13 @@ class JavaHelper(gump.core.run.gumprun.R
# Add to CLASSPATH
if not jar.getType() == OUTPUT_BOOTCLASSPATH_JAR:
if debug:
- print str(depth) + ') Append JAR : ' + str(path)
+ print(str(depth) + ') Append JAR : ' + str(path))
classpath.addPathPart(path)
else:
# Add to BOOTCLASSPATH
if debug:
- print str(depth) + ') Append *BOOTCLASSPATH* JAR : ' \
- + str(path)
+ print(str(depth) + ') Append *BOOTCLASSPATH* JAR : ' \
+ + str(path))
bootclasspath.addPathPart(path)
# Double check IDs (to reduce stale ids in metadata)
@@ -277,8 +277,8 @@ class JavaHelper(gump.core.run.gumprun.R
debug)
_importClasspaths(classpath, bootclasspath, subcp, subbcp)
elif debug:
- print str(depth) + ') Skip : ' + str(subdependency) \
- + ' in ' + project.name
+ print(str(depth) + ') Skip : ' + str(subdependency) \
+ + ' in ' + project.name)
return (classpath, bootclasspath)
Modified: gump/branches/python3/python/gump/core/language/path.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/core/language/path.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/core/language/path.py (original)
+++ gump/branches/python3/python/gump/core/language/path.py Sun Nov 29 00:59:43 2020
@@ -22,7 +22,6 @@
"""
import os
-from string import split
from gump.util.note import transferAnnotations, Annotatable
#
@@ -104,7 +103,7 @@ class ArtifactPath(Annotatable):
def addPathPart(self,part):
if part in self.parts:
- self.addDebug('Duplicate Path Part [' + `part` + ']')
+ self.addDebug('Duplicate Path Part [' + repr(part) + ']')
else:
self.parts.append(part)
Modified: gump/branches/python3/python/gump/core/loader/loader.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/core/loader/loader.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/core/loader/loader.py (original)
+++ gump/branches/python3/python/gump/core/loader/loader.py Sun Nov 29 00:59:43 2020
@@ -40,7 +40,7 @@ class XmlLoader:
""" Builds a GOM in memory from the xml file. Return the generated GOM. """
if not os.path.exists(file):
- raise IOError, 'Metadata file [%s] not found.' % file
+ raise IOError('Metadata file [%s] not found.' % file)
return self.load(file,tag)
@@ -70,7 +70,7 @@ class XmlLoader:
if not os.path.exists(file):
log.error('Metadata file [' + file + '] not found')
- raise IOError, 'Metadata File %s not found.' % file
+ raise IOError('Metadata File %s not found.' % file)
dom=xml.dom.minidom.parse(file)
@@ -87,7 +87,7 @@ class XmlLoader:
if tag:
if not tag == xtag:
dom.unlink()
- raise IOError, 'Incorrect XML Element, expected %s found %s.' % (tag,xtag)
+ raise IOError('Incorrect XML Element, expected %s found %s.' % (tag,xtag))
return dom
@@ -165,7 +165,7 @@ class XmlWorker:
self.postProcess(task,dom)
task.setResult(XmlResult(dom))
- except Exception, details:
+ except Exception as details:
log.warning('Failed to parse XML %s : %s' % (task.getDescription(),details))
@@ -193,7 +193,7 @@ class XmlWorker:
elif child.nodeType == xml.dom.Node.TEXT_NODE:
pass # log.debug("Skip Text: " + `child.nodeType`)
else:
- log.debug("Skip Node: " + `child.nodeType` + ' ' + `child`)
+ log.debug("Skip Node: " + repr(child.nodeType) + ' ' + repr(child))
class ModelLoader:
"""
@@ -246,8 +246,8 @@ class ModelLoader:
if parentObject:
object=parentObject.getObjectForTag(element.tagName,dom,name)
- log.debug("Used parent: %s to get %s for <%s %s" %(`parentObject`,`object`,
- `element.tagName`,`name`))
+ log.debug("Used parent: %s to get %s for <%s %s" %(repr(parentObject),repr(object),
+ repr(element.tagName),repr(name)))
else:
# Just construct
if name: object=cls(name,dom)
@@ -273,7 +273,7 @@ class ModelLoader:
# transferAnnotations(parser, object)
if not rootObject:
- raise RuntimeError, 'Failed to extract %s from XML.' % cls.__name__
+ raise RuntimeError('Failed to extract %s from XML.' % cls.__name__)
return rootObject
Modified: gump/branches/python3/python/gump/core/model/builder.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/core/model/builder.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/core/model/builder.py (original)
+++ gump/branches/python3/python/gump/core/model/builder.py Sun Nov 29 00:59:43 2020
@@ -60,7 +60,7 @@ class Builder(ModelObject, PropertyConta
if not self.project:
return self.__class__.__name__
else:
- return self.__class__.__name__ + ' on ' + `self.project`
+ return self.__class__.__name__ + ' on ' + repr(self.project)
#
# expand properties - in other words, do everything to complete the
@@ -440,7 +440,7 @@ class MvnInstall(Maven):
prop = Property(MvnInstall.VERSION, dom, self.project)
prop.complete(self.project, self.project.getWorkspace())
props.append(prop)
- except Exception, details:
+ except Exception as details:
self.project.addError('failed to parse POM because of '
+ str(details))
return props
Modified: gump/branches/python3/python/gump/core/model/depend.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/core/model/depend.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/core/model/depend.py (original)
+++ gump/branches/python3/python/gump/core/model/depend.py Sun Nov 29 00:59:43 2020
@@ -146,7 +146,7 @@ class ProjectDependency(Annotatable):
return self.project
def hasInheritence(self):
- return self.inherit <> INHERIT_NONE
+ return self.inherit != INHERIT_NONE
def getInheritence(self):
return self.inherit
@@ -245,7 +245,7 @@ class DependSet:
dependProject = depend.getOwnerProject()
else:
dependProject = depend.getProject()
- if not self.projectMap.has_key(dependProject):
+ if dependProject not in self.projectMap:
self.projectMap[dependProject] = []
self.projectMap[dependProject] = depend
@@ -253,13 +253,13 @@ class DependSet:
return (depend in self.depends)
def containsProject(self, project):
- return self.projectMap.has_key(project)
+ return project in self.projectMap
def getDepends(self):
return self.depends
def getUniqueProjectDependList(self):
- return self.projectMap.keys()
+ return list(self.projectMap.keys())
def getUniqueProjectDependCount(self):
return len(self.projectMap)
Modified: gump/branches/python3/python/gump/core/model/misc.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/core/model/misc.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/core/model/misc.py (original)
+++ gump/branches/python3/python/gump/core/model/misc.py Sun Nov 29 00:59:43 2020
@@ -30,6 +30,9 @@ class Positioned:
self.posn = -1
self.total = -1
+ def __del__(self):
+ pass
+
def setPosition(self, posn):
""" Set this object's position (within some sequence) """
self.posn = posn
@@ -54,6 +57,10 @@ class Resultable:
def __init__(self):
pass
+ def __del__(self):
+ self.results=None
+ self.serverResults=None
+
# Stats are loaded separately and cached on here,
# hence they may exist on an object at all times.
def hasServerResults(self):
@@ -64,8 +71,8 @@ class Resultable:
def getServerResults(self):
if not self.hasServerResults():
- raise RuntimeError, "ServerResults not available [yet]: " \
- + self.getName()
+ raise RuntimeError("ServerResults not available [yet]: " \
+ + self.getName())
return self.serverResults
@@ -79,8 +86,8 @@ class Resultable:
def getResults(self):
if not self.hasResults():
- raise RuntimeError, "Results not available [yet]: " \
- + self.getName()
+ raise RuntimeError("Results not available [yet]: " \
+ + self.getName())
return self.results
class Resolvable(ModelObject):
Modified: gump/branches/python3/python/gump/core/model/module.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/core/model/module.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/core/model/module.py (original)
+++ gump/branches/python3/python/gump/core/model/module.py Sun Nov 29 00:59:43 2020
@@ -286,6 +286,12 @@ class Module(NamedModelObject, Statable,
self.groupId = None
+ def __lt__(self, other):
+ return self.name < other.name # TEMPORARY
+
+ def __gt__(self, other):
+ return self.name > other.name # TEMPORARY
+
def getObjectForTag(self, tag, dom, name = None):
"""
Get a new (or spliced) object for this tag
@@ -402,13 +408,13 @@ class Module(NamedModelObject, Statable,
if not packageCount:
allPackaged = False
- log.debug('Packaged? ' + `self` + ':' + `packageCount`)
+ log.debug('Packaged? ' + repr(self) + ':' + repr(packageCount))
# Give this module a second try, if some are packaged, and
# check if the others have no outputs, then call them good.
if packageCount and not allPackaged:
- log.debug('Packaged? ' + `self` + ':' + `packageCount`)
+ log.debug('Packaged? ' + repr(self) + ':' + repr(packageCount))
allPackaged = True
for project in self.getProjects():
@@ -437,7 +443,7 @@ class Module(NamedModelObject, Statable,
self.setPackaged(True)
self.changeState(STATE_COMPLETE, REASON_PACKAGE)
self.addInfo("\'Packaged\' Module. (Packaged projects: " + \
- `packageCount` + '.)')
+ repr(packageCount) + '.)')
# Determine source directory
self.absWorkingDir = \
@@ -540,7 +546,7 @@ class Module(NamedModelObject, Statable,
name = project.getName()
if self.hasProject(name):
- raise RuntimeError, 'Attempt to add duplicate project: ' + name
+ raise RuntimeError('Attempt to add duplicate project: ' + name)
# Reference this module as owner
project.setModule(self)
@@ -555,17 +561,16 @@ class Module(NamedModelObject, Statable,
otherProject = self.getOwner().getProject(name)
if not project is otherProject:
- raise RuntimeError, \
- 'Attempt to add duplicate project (in module): ' + name
+ raise RuntimeError('Attempt to add duplicate project (in module): ' + name)
def hasProject(self, name):
- return self.projects.has_key(name)
+ return name in self.projects
def getProject(self, name):
return self.projects[name]
def getProjects(self):
- return self.projects.values()
+ return list(self.projects.values())
def getSortedProjects(self):
return self.sortedProjects
Modified: gump/branches/python3/python/gump/core/model/object.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/core/model/object.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/core/model/object.py (original)
+++ gump/branches/python3/python/gump/core/model/object.py Sun Nov 29 00:59:43 2020
@@ -22,7 +22,6 @@
"""
from time import localtime, strftime, tzname
-from string import lower, capitalize
from gump.util.note import *
from gump.util.work import *
@@ -148,8 +147,8 @@ class ModelObject(Annotatable,Workable,F
""" Display the contents of this object """
# output.write(getIndent(indent)+'Class: ' + self.__class__.__name__ + '\n')
if self.hasOwner():
- output.write(getIndent(indent)+'Owner: ' + `self.getOwner()` + '\n')
- output.write(getIndent(indent)+'Id: ' + `id(self)` + '\n')
+ output.write(getIndent(indent)+'Owner: ' + repr(self.getOwner()) + '\n')
+ output.write(getIndent(indent)+'Id: ' + repr(id(self)) + '\n')
#output.write(getIndent(indent)+'Id DOM: ' + `id(self.dom)` + '\n')
#output.write(getIndent(indent)+'Id Element: ' + `id(self.element)` + '\n')
if self.isSpliced():
@@ -268,7 +267,7 @@ class ModelObject(Annotatable,Workable,F
def splice(self,dom):
if self.isComplete():
- raise RuntimeError, "Can't splice a completed entity: " + `self`
+ raise RuntimeError("Can't splice a completed entity: " + repr(self))
# log.debug("Splice: " + `dom`)
spliceDom(self.element,dom)
self.setSpliced(True)
@@ -293,7 +292,7 @@ class NamedModelObject(ModelObject):
# Named
self.name=name
if not name:
- raise RuntimeError, self.__class__.__name__ + ' needs a name.'
+ raise RuntimeError(self.__class__.__name__ + ' needs a name.')
self.hash=0
Modified: gump/branches/python3/python/gump/core/model/profile.py
URL: http://svn.apache.org/viewvc/gump/branches/python3/python/gump/core/model/profile.py?rev=1883919&r1=1883918&r2=1883919&view=diff
==============================================================================
--- gump/branches/python3/python/gump/core/model/profile.py (original)
+++ gump/branches/python3/python/gump/core/model/profile.py Sun Nov 29 00:59:43 2020
@@ -20,7 +20,6 @@
"""
from time import localtime, strftime, tzname
-from string import lower, capitalize
from gump.util.work import *
from gump.util.tools import *