def _printInformationImpl(filePath, targetString):
    mylist = []
    today = _datetime.date.today()
    # Append the Date into a list, so it can be printed.
    mylist.append(today)
    # Represents your git repository path.
    repo = _Repo(filePath)
    print('Information about ' + targetString)
    print('============================================================')
    print("Date: " + str(mylist[0]))
    print('Python Version: ' + _sys.version)
    print('Git directory: ' + _findGitRepo(filePath))
    print('Current git SHA: ' + repo.commit().hexsha)
    print 'Remotes:',
    for r in repo.remotes:
        print r.name + ',',
    print('\n'+'Current branch: ' + str(repo.active_branch))
    for r in repo.remotes:
        exec('tempLoop = repo.remotes.' + r.name + '.url')
        print('%s remote URL: ' % (r.name) + tempLoop)
def _printInformationImpl(filePath, targetString):
    mylist = []
    today = _datetime.date.today()
    # Append the Date into a list, so it can be printed.
    mylist.append(today)
    # Represents your git repository path.
    repo = _Repo(filePath)
    print ("Information about " + targetString)
    print ("============================================================")
    print ("Date: " + str(mylist[0]))
    print ("Python Version: " + _sys.version)
    print ("Git directory: " + _findGitRepo(filePath))
    print ("Current git SHA: " + repo.commit().hexsha)
    print "Remotes:",
    for r in repo.remotes:
        print r.name + ",",
    print ("\n" + "Current branch: " + str(repo.active_branch))
    for r in repo.remotes:
        exec ("tempLoop = repo.remotes." + r.name + ".url")
        print ("%s remote URL: " % (r.name) + tempLoop)
示例#3
0
def _printInformationImpl(filePath, targetString):
    mylist = []
    today = _datetime.date.today()
    # Append the Date into a list, so it can be printed.
    mylist.append(today)
    # Represents your git repository path.
    repo = _Repo(filePath)
    print('Information about ' + targetString)
    print('============================================================')
    print("Date: " + str(mylist[0]))
    print('Python Version: ' + _sys.version)
    print('Git directory: ' + _findGitRepo(filePath))
    print('Current git SHA: ' + repo.commit().hexsha)
    print 'Remotes:',
    for r in repo.remotes:
        print r.name + ',',
    print('\n' + 'Current branch: ' + str(repo.active_branch))
    for r in repo.remotes:
        exec('tempLoop = repo.remotes.' + r.name + '.url')
        print('%s remote URL: ' % (r.name) + tempLoop)
def _currentBranchImpl(filePath):
    repo = _Repo(filePath)
    # Print current branch.
    print ("Current branch: " + str(repo.active_branch))
def _currentRemoteImpl(filePath):
    repo = _Repo(filePath)
    # Print current remote of your repository.
    print ("Current remote: " + str(repo.remote()))
def _currentGitSHAImpl(filePath):
    repo = _Repo(filePath)
    # Print current git commit hash code.
    print ("Current git SHA: " + repo.commit().hexsha)
示例#7
0
            raise RuntimeError("PATHS is readonly.")
        else:
            # We could still overwrite _d, but who does that?
            super(_Paths, self).__setattr__(name, val)

    def __repr__(self):
        m = max(map(len, list(self._d.keys()))) + 1
        return '\n'.join(
            [name.rjust(m) + ': ' + path for name, path in self._d.items()])


# Insert the current branch name to automatically switch to a new work dir
_repo_path = _os.path.join("/home", "tmenne", "analysis",
                           "hese_transient_stacking_analysis")
_repo_name = _os.path.basename(_repo_path)
_repo = _Repo(_repo_path)
_BRANCH_NAME = _repo.active_branch.name

_paths = {
    "repo":
    _repo_path,
    "local":
    _os.path.join(_repo_path, "out_" + _BRANCH_NAME),
    "data":
    _os.path.join("/data", "user", "tmenne", _repo_name,
                  "rawout_" + _BRANCH_NAME),
    "jobs":
    _os.path.join(_repo_path, "jobfiles_" + _BRANCH_NAME),
    "plots":
    _os.path.join(_repo_path, "plots_" + _BRANCH_NAME),
}
示例#8
0
def _currentBranchImpl(filePath):
    repo = _Repo(filePath)
    # Print current branch.
    print('Current branch: ' + str(repo.active_branch))
示例#9
0
def _currentRemoteImpl(filePath):
    repo = _Repo(filePath)
    # Print current remote of your repository.
    print('Current remote: ' + str(repo.remote()))
示例#10
0
def _currentGitSHAImpl(filePath):
    repo = _Repo(filePath)
    # Print current git commit hash code.
    print('Current git SHA: ' + repo.commit().hexsha)