This object contains the setings to interact with the gerrit server, nothing fancy these are just
sensible defaults.
'''
- def __init__(self):
- self.data_location = 'data'
+ def __init__(self, args):
+ self.data_location = args.output
self.host = 'gerrit.wikimedia.org'
self.port = 29418
self.format = 'JSON'
self.set_charttype()
filename = '%s.yaml' % (self.repo.determine_filename())
- print self.repo.directory
full_path = os.path.join(self.repo.directory, filename)
- print 'filename: %s' % filename
fh = open(full_path, 'w')
fh.write(self.buffer.getvalue())
fh.close()
\ No newline at end of file
import subprocess
import json
import sys
-import os
+import argparse
from datetime import datetime
from classes import Gerrit, Settings, Metric, Repo, YamlConfig
repo.touched = True
+def parse_commandline():
+ parser = argparse.ArgumentParser(description='Process some integers.')
+ parser.add_argument('--output', help='Specify the absolute path to store the gerrit-stats datasets.')
+ return parser.parse_args()
+
def main():
- gerrit = Gerrit()
+ args = parse_commandline()
+ gerrit = Gerrit(args)
settings = Settings(gerrit)
print 'Fetching list of all gerrit repositories...\n'
repos = create_repo_set(gerrit, settings)