Changeset c23d45f
- Timestamp:
- Mar 13, 2017, 11:11:14 PM (8 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, sampler
- Children:
- 07bfe2d2
- Parents:
- f77820d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
this_version.py
rf77820d rc23d45f 11 11 global __version_info 12 12 if not __version_info: 13 this_file_dir = os.path.dirname(os.path.abspath(__file__))14 version_file = os.path.join(this_file_dir, 'VERSION')13 this_file_dir = os.path.dirname(os.path.abspath(__file__)) 14 version_file = os.path.join(this_file_dir, 'VERSION') 15 15 16 if not os.path.isfile(version_file):17 raise SystemError("VERSION file not found.")16 if not os.path.isfile(version_file): 17 raise SystemError("VERSION file not found.") 18 18 19 19 20 for l in open(version_file).readlines():21 #exec (l.strip())22 if l.startswith('AUBIO_MAJOR_VERSION'):23 __version_info['AUBIO_MAJOR_VERSION'] = int(l.split('=')[1])24 if l.startswith('AUBIO_MINOR_VERSION'):25 __version_info['AUBIO_MINOR_VERSION'] = int(l.split('=')[1])26 if l.startswith('AUBIO_PATCH_VERSION'):27 __version_info['AUBIO_PATCH_VERSION'] = int(l.split('=')[1])28 if l.startswith('AUBIO_VERSION_STATUS'):29 __version_info['AUBIO_VERSION_STATUS'] = l.split('=')[1].strip()[1:-1]20 for l in open(version_file).readlines(): 21 #exec (l.strip()) 22 if l.startswith('AUBIO_MAJOR_VERSION'): 23 __version_info['AUBIO_MAJOR_VERSION'] = int(l.split('=')[1]) 24 if l.startswith('AUBIO_MINOR_VERSION'): 25 __version_info['AUBIO_MINOR_VERSION'] = int(l.split('=')[1]) 26 if l.startswith('AUBIO_PATCH_VERSION'): 27 __version_info['AUBIO_PATCH_VERSION'] = int(l.split('=')[1]) 28 if l.startswith('AUBIO_VERSION_STATUS'): 29 __version_info['AUBIO_VERSION_STATUS'] = l.split('=')[1].strip()[1:-1] 30 30 31 if l.startswith('LIBAUBIO_LT_CUR'):32 __version_info['LIBAUBIO_LT_CUR'] = int(l.split('=')[1])33 if l.startswith('LIBAUBIO_LT_REV'):34 __version_info['LIBAUBIO_LT_REV'] = int(l.split('=')[1])35 if l.startswith('LIBAUBIO_LT_AGE'):36 __version_info['LIBAUBIO_LT_AGE'] = int(l.split('=')[1])31 if l.startswith('LIBAUBIO_LT_CUR'): 32 __version_info['LIBAUBIO_LT_CUR'] = int(l.split('=')[1]) 33 if l.startswith('LIBAUBIO_LT_REV'): 34 __version_info['LIBAUBIO_LT_REV'] = int(l.split('=')[1]) 35 if l.startswith('LIBAUBIO_LT_AGE'): 36 __version_info['LIBAUBIO_LT_AGE'] = int(l.split('=')[1]) 37 37 38 if len(__version_info) <6:39 raise SystemError("Failed parsing VERSION file.")38 if len(__version_info) <6: 39 raise SystemError("Failed parsing VERSION file.") 40 40 41 41 42 # switch version status with commit sha in alpha releases43 if __version_info['AUBIO_VERSION_STATUS'] and \44 '~alpha' in __version_info['AUBIO_VERSION_STATUS'] :45 AUBIO_GIT_SHA = get_git_revision_hash()46 if AUBIO_GIT_SHA:47 __version_info['AUBIO_VERSION_STATUS'] = '~git'+AUBIO_GIT_SHA42 # switch version status with commit sha in alpha releases 43 if __version_info['AUBIO_VERSION_STATUS'] and \ 44 '~alpha' in __version_info['AUBIO_VERSION_STATUS'] : 45 AUBIO_GIT_SHA = get_git_revision_hash() 46 if AUBIO_GIT_SHA: 47 __version_info['AUBIO_VERSION_STATUS'] = '~git'+AUBIO_GIT_SHA 48 48 49 49 return __version_info … … 77 77 if add_status and vdict['AUBIO_VERSION_STATUS'] : 78 78 if '~git' in vdict['AUBIO_VERSION_STATUS']: 79 verstr += "+a0."+vdict['AUBIO_VERSION_STATUS'][1:]79 verstr += "+a0."+vdict['AUBIO_VERSION_STATUS'][1:] 80 80 elif '~alpha': 81 verstr += "+a0"81 verstr += "+a0" 82 82 else: 83 raise SystemError("Aubio version statut not supported : %s"%vdict['AUBIO_VERSION_STATUS'])83 raise SystemError("Aubio version statut not supported : %s"%vdict['AUBIO_VERSION_STATUS']) 84 84 return verstr 85 85 … … 98 98 gitcmd = ['git','-C',aubio_dir ,'rev-parse'] 99 99 if short: 100 gitcmd.append('--short')100 gitcmd.append('--short') 101 101 gitcmd.append('HEAD') 102 102 try: 103 outCmd = subprocess.check_output(gitcmd).strip().decode('utf8')103 outCmd = subprocess.check_output(gitcmd).strip().decode('utf8') 104 104 except Exception as e: 105 print ('git command error :%s'%e)106 return None105 print ('git command error :%s'%e) 106 return None 107 107 return outCmd 108 108
Note: See TracChangeset
for help on using the changeset viewer.