def doAdd(self): con = RepoManager() added = IRepository() #potrzeba sprawdzenia czy dane sa jako tako dobre i czy w ogole sa added.assign(request.params['name'], request.params['url'], request.params['comment'], request.params['type']) if request.params['login']: added.setAuth(request.params['login'], request.params['password']) added.setTestAttributes(request.params['build_cmd'], request.params['find_tests'], request.params['run_test']) if 'compile' in request.params and request.params['compile'] == 'on': added.compileOnServer = True con.addRepository(added) c.message = 'Pomyslnie dodano repozytorium %s ' % request.params['name'] c.link = '/repository' return render('/message.mako')
def doEdit(self): rep = IRepository() rep.assign(request.params['name'], request.params['url'], request.params['comment'], request.params['type']) if request.params['login']: rep.setAuth(request.params['login'], request.params['password']) rep.setTestAttributes(request.params['build_cmd'], request.params['find_tests'], request.params['run_test']) if 'compile' in request.params and request.params['compile'] == 'on': rep.compileOnServer = True if RepoManager().updateRepository(rep, request.params['old_name']): c.message = 'Pomyslnie edytowano repozytorium %s .' % request.params['old_name'] else: c.message = 'Wystapil blad podczas edycji repozytorium %s. \ Sprobuj ponownie pozniej, lub skontaktuj sie z administratorem.' % request.params['old_name'] c.link = '/repository' return render('/message.mako')
def setUpRepositoryObject(row): repo = IRepository() repo.assign(row[0], row[1], row[2], row[3]) if row[4] and len(row[4]) > 0: repo.setAuth(row[4], row[5]) tmp1, tmp2, tmp3 = '','','' if row[6] is not None: tmp1 = row[6] if row[7] is not None: tmp2 = row[7] if row[8] is not None: tmp3 = row[8] repo.setTestAttributes(tmp1, tmp2, tmp3) if row[9] == 1: repo.compileOnServer = True return repo