def __call__(self, parser, namespace, values, option_string=None): Log.cd('%r %r %r' % (namespace, values, option_string)) # sync = sys.modules['__main__'] # http://stackoverflow.com/ # questions/13181559#comment17940192_13181615 setattr(namespace, self.dest, values) # print sync.Sync.sync_client Sync.newRequest(host=namespace.host, repo=values)
def __init__(self, ignored_files=None, repo=None, append=False): # path to the .git/info/exclude file self._exclude = exclude = os.path.join(repo.git_dir, "info", "exclude") Log.cd("Exclude file: %s", exclude) if not ignored_files: return mode = 'ab' if append else 'wb' # 'w' will truncate - 'b' for # unix newlines with open(exclude, mode) as excl: for path in ignored_files: # TODO check that paths are subpaths and valid excl.write(path + "\n")