def _split_projects(owner: str, repos: pd.Series): """ Creates a new Project-object for each owner/repo combination. Starts the analysis process on each Project :param owner: owner name :param repos: pd.Series containing repository names :return: -- """ pullreq_data, issue_data, commit_data = _import_comment_data(owner) for repo in repos: proc_time_start = time.process_time() if conf.output_verbose: print(">>> analyzing {0}/{1}".format(owner, repo)) else: print("analyzing {0}/{1}".format(owner, repo)) project_pullreq_data = pullreq_data[pullreq_data["repo_id"] == repo] project_issue_data = issue_data[issue_data["repo_id"] == repo] Project(project_pullreq_data, project_issue_data, commit_data, owner, repo).run() if conf.output_verbose: print("time required: {0:.2f}s".format( time.process_time() - proc_time_start)) print() print("---------------------------------") print() else: print("{0:.2f}s".format(time.process_time() - proc_time_start)) print()
def load_projects(self): with open('./resources/projects.json', 'r') as file: data = json.load(file) for project in data: self.projects.append( Project(project['name'], project['repo_link'], project['port']))
def load_config(file_path): f = open(file_path) dataMap = yaml.safe_load(f) f.close() projects = [] for project in sorted(dataMap['Projects'], reverse=True): projects.append(Project(**dataMap['Projects'][project])) return dataMap['Portfolio'], projects
def put(): ''' Create a new project. -> name -> repo_link -> port ''' result = manager.add_project( Project(request.form['name'], request.form['repo_link'], request.form['port'])) return jsonify({'error': result}) # Project successfully added
def project_create_page_config(submit_type): if submit_type == 'GET': listProjectType = GetProjectType() listProjectThesisType = GetProjectThesisType() listDepartment = GetDepartment() listProjectStatusType = GetProjectStatusType() listManager = GetManagerList() return render_template('projects/create_project.html', listProjectType=listProjectType, listProjectThesisType=listProjectThesisType, listDepartment=listDepartment, listProjectStatusType=listProjectStatusType, listManager=listManager) else: if 'Add' in request.form.values(): store = project_operations() title = request.form['project_name'] project_description = request.form['project_description'] project_type = request.form['project_type'] project_thesis_type = request.form['project_thesis_type'] department = request.form['department'] start_date = request.form['start'] #start_date = None end_date = request.form['end_date'] if end_date > str( datetime.datetime.now()): #ileri tarihte bitecekse project_status_type = 2 else: #süre bitmişse project_status_type = 3 member_limit = request.form['limit'] created_by = person_operations.GetPerson( current_user, current_user.email)[0] #current_user proje oluşturuyor manager = request.form['project_manager'] project = Project(None, title, project_description, project_type, project_thesis_type, department, project_status_type, start_date, end_date, member_limit, None, created_by, manager) store.add_project(project) id = store.get_last() TeamProvider = team_operations() TeamProvider.AddTeam(id, manager, 'Manager') return redirect(url_for('site.home_page'))
with open(file_name) as f: self.urls = json.load(f) def set_assignments_per_HIT(self, assignments_per_HIT): self.assignments_per_HIT = assignments_per_HIT def set_questions_per_HIT(self, questions_per_HIT): self.questions_per_HIT = questions_per_HIT if __name__ == '__main__': from classes.project import Project from opencrowd.config.opencrowd import CROWDSOURCE_SPECIFICATION template = BoundingBoxTemplate() template.add_file('BoundingBoxMulti.json') template.set_assignments_per_HIT(3) template.set_questions_per_HIT(3) template.create_HITs() project = Project('Testing Project', 'Description of the Test Project', CROWDSOURCE_SPECIFICATION) project.add_task(template.task) for task_id in project.tasks: project.submit_task(task_id) exit(1)
else: print("Uso: %s -p project_path" % sys.argv[0]) break try: Common.params["root_path"] = os.path.dirname( sys.modules['__main__'].__file__) Common.params["project_path"] = project_path lang = gt.translation('classiccompiler', localedir=os.path.join(Common.params["root_path"], 'locale'), languages=['pt_BR']) lang.install() project = Project() print(_("Compilando...")) print( _("Máquina: %s, CPU: %s") % (project.machine["name"], project.machine["cpu"])) compiler = Compiler(project) compiler.compile() for file in compiler.files: filename = file['filename'] tree = file['tree'] text_file = open("tree_" + filename.replace('.', '_') + ".txt", "w") text_file.write(tree.pretty())
def create_project(self, name): project = Project(name) self.projects.append(project) self.all_projects.append(project) return project