home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2008 February / PCWFEB08.iso / Software / Freeware / Chandler 0.7.2 / Chandler_win_0.7.2.exe / version.py < prev   
Encoding:
Python Source  |  2007-11-13  |  2.6 KB  |  82 lines

  1. _version = { 'release':    '0.7.2',
  2.              'build':      '',
  3.              'checkpoint': None,
  4.              'revision':   None,
  5.            }
  6.  
  7. #!#!#!#!# <-- used by build_lib.py to mark end of _version def
  8. # Note: do not edit or change anything above this comment block
  9. #       as it can/will be replaced during the build process
  10. #
  11. #     continuous build        build = '.dev'
  12. #                             checkpoint = YYYYMMDDHHMMSS
  13. #                             revision set by caller
  14. #
  15. #     checkpoint build        build = '.dev'
  16. #                             checkpoint value set to YYYYMMDD
  17. #                             revision set by caller
  18. #
  19. #     Milestone or Release    build = ''
  20. #                             checkpoint = None
  21. #                             revision = None
  22.  
  23. _template = '%(release)s'
  24.  
  25. if len(_version['build']) > 0:
  26.     _template += '%(build)s'
  27.  
  28.     # dig into the file system to figure out what the revision number is
  29.     # but only if the build system hasn't provided one
  30.     if _version['revision'] is None:
  31.         import os
  32.  
  33.         try:
  34.             chandlerDir = os.path.dirname(__file__)
  35.         except:
  36.             chandlerDir = '.'
  37.  
  38.             # pull the .svn/entries file from the directory where version.py resides
  39.             # and read the value for the revision property
  40.  
  41.         svnfile = os.path.join(chandlerDir, '.svn', 'entries')
  42.  
  43.         if os.path.isfile(svnfile):
  44.             # svn 1.3
  45.             for line in file(svnfile):
  46.                 items = line.split('=')
  47.  
  48.                 if len(items) == 2:
  49.                     item, value = items
  50.  
  51.                     if item.strip().lower() == 'revision':
  52.                         _version['revision'] = value[:-1].strip('">/')
  53.  
  54.             # svn 1.4
  55.             if _version['revision'] == None:
  56.                 revisions = []
  57.                 for line in file(svnfile):
  58.                     try:
  59.                         revisions.append(long(line))
  60.                     except ValueError:
  61.                         pass
  62.                 revisions.sort()
  63.                 _version['revision'] = str(revisions[-1])
  64.  
  65.     if _version['revision'] is not None:
  66.         _template += '-r%(revision)s'
  67.  
  68.     if _version['checkpoint'] is not None:
  69.         # continuous builds do not use -checkpoint text
  70.         if len(_version['checkpoint']) > 8:
  71.             _template += '-%(checkpoint)s'
  72.         else:
  73.             _template += '-checkpoint%(checkpoint)s'
  74.  
  75. release    = _version['release']
  76. build      = '%s' % _version['build']
  77. checkpoint = '%s' % _version['checkpoint']
  78. revision   = '%s' % _version['revision']
  79. version    = _template % _version
  80.  
  81. platform = "Windows"
  82.