def changeAllProjectVersions(root, versionTemplate, today=None):
 if (not today):
  today = date.today().strftime('%Y-%m-%d')
 for project in findTwistedProjects(root):
  if (project.directory.basename() == 'twisted'):
   packageName = 'twisted'
  else:
   packageName = ('twisted.' + project.directory.basename())
  oldVersion = project.getVersion()
  newVersion = Version(packageName, versionTemplate.major, versionTemplate.minor, versionTemplate.micro, prerelease=versionTemplate.prerelease)
  if oldVersion.prerelease:
   builder = NewsBuilder()
   builder._changeNewsVersion(root.child('NEWS'), builder._getNewsName(project), oldVersion, newVersion, today)
   builder._changeNewsVersion(project.directory.child('topfiles').child('NEWS'), builder._getNewsName(project), oldVersion, newVersion, today)
  if (packageName == 'twisted'):
   _changeVersionInFile(oldVersion, newVersion, root.child('README').path)
  project.updateVersion(newVersion)

def changeAllProjectVersions ( root , versionTemplate , today = None ) : if ( not today ) : today = date . today ( ) . strftime ( '%Y-%m-%d' ) for project in findTwistedProjects ( root ) : if ( project . directory . basename ( ) == 'twisted' ) : packageName = 'twisted' else : packageName = ( 'twisted.' + project . directory . basename ( ) ) oldVersion = project . getVersion ( ) newVersion = Version ( packageName , versionTemplate . major , versionTemplate . minor , versionTemplate . micro , prerelease = versionTemplate . prerelease ) if oldVersion . prerelease : builder = NewsBuilder ( ) builder . _changeNewsVersion ( root . child ( 'NEWS' ) , builder . _getNewsName ( project ) , oldVersion , newVersion , today ) builder . _changeNewsVersion ( project . directory . child ( 'topfiles' ) . child ( 'NEWS' ) , builder . _getNewsName ( project ) , oldVersion , newVersion , today ) if ( packageName == 'twisted' ) : _changeVersionInFile ( oldVersion , newVersion , root . child ( 'README' ) . path ) project . updateVersion ( newVersion )
change the version of all projects .