def checkGithub(): commits_behind = 0 cur_commit = headphones.CURRENT_VERSION latest_commit = None gh = github.GitHub() for curCommit in gh.commits.forBranch('rembo10', 'headphones', version.HEADPHONES_VERSION): if not latest_commit: latest_commit = curCommit.id if not cur_commit: break if curCommit.id == cur_commit: break commits_behind += 1 headphones.LATEST_VERSION = latest_commit headphones.COMMITS_BEHIND = commits_behind if headphones.LATEST_VERSION == headphones.CURRENT_VERSION: logger.info('Headphones is already up-to-date.') return latest_commit
def _check_github_for_update(self): """ Uses pygithub to ask github if there is a newer version that the provided commit hash. If there is a newer version it sets Sick Beard's version text. commit_hash: hash that we're checking against """ self._num_commits_behind = 0 self._newest_commit_hash = None gh = github.GitHub() # find newest commit for curCommit in gh.commits.forBranch('Diaoul', 'Sick-Beard', version.SICKBEARD_VERSION): if not self._newest_commit_hash: self._newest_commit_hash = curCommit.id if not self._cur_commit_hash: break if curCommit.id == self._cur_commit_hash: break self._num_commits_behind += 1 logger.log( u"newest: " + str(self._newest_commit_hash) + " and current: " + str(self._cur_commit_hash) + " and num_commits: " + str(self._num_commits_behind), logger.DEBUG)
print "Copying file from", curFile, "to", newFile shutil.copy(curFile, newFile) # compile updater.exe setup( options = {'py2exe': {'bundle_files': 1}}, zipfile = None, console = ['updater.py'], ) if 'test' in oldArgs: print "Ignoring changelog for test build" else: # start building the CHANGELOG.txt print 'Creating changelog' gh = github.GitHub() # read the old changelog and find the last commit from that build lastCommit = "" try: cl = open("CHANGELOG.txt", "r") lastCommit = cl.readlines()[0].strip() cl.close() except: print "I guess there's no changelog" newestCommit = "" changeString = "" # cycle through all the git commits and save their commit messages for curCommit in gh.commits.forBranch('midgetspy', 'Sick-Beard'):