def run_project(args): options = Options() options.parse(args[1:]) project = Project(options) print 'Archirtecture chosen:', project.print_arg()
def post(self): detailedDescription = self.request.get("detailedDescription") count=int(self.request.get("count")) projectObject = Project() user=users.get_current_user() if user: userid = user.user_id() authenticationUser = User.query(User.userid==userid).fetch(1) authenticationNGO = NGO.query(NGO.userid==userid).fetch(1) if authenticationNGO: ngo = projectObject.ngo existingProject = Project.query(Project.ngo==userid).fetch(1) if existingProject: projectObject.detailedDescription = detailedDescription while count>0: j=1 Counter=str(count-count+j) taskTitle = self.request.get("taskTitle"+Counter) taskDescription = self.request.get("taskDescription"+Counter) taskFund = self.request.get("taskFund"+Counter) count=count-1 j=j-1 projectObject.tasks = [TaskList(taskTitle = taskTitle, taskDescription = taskDescription, taskFund = taskFund)] projectObject.put() self.redirect("/home") else: self.redirect("/propose") elif authenticationUser: self.redirect("/home") else: self.redirect("/") else: self.redirect("/login")
def start(args): options = Options() options.parse(args) project = Project(options) project.run()
def run_project(args): options = Options() options.parse(args[1:]) project = Project(options) print 'Printing date:', project.date() print 'Printing example arg:', project.print_example_arg()
def run(args): options = Options() options.parse(args[1:]) project = Project(options) print 'Architecture chosen:', project.print_arg() project.run_command()
def get(self): for i in range(100): project = Project() project.title = str(random.randrange(20, 10000)) project.authenticity = False project.description = str( random.randrange(1, 100000000000000000000)) project.ngo = str(random.randrange(1, 1000000)) project.put() self.response.write("Done!")
def post(self): category = self.request.get("category") title = self.request.get("title") user = users.get_current_user() userid = user.user_id() projectObject = Project() projectObject.ngo = userid projectObject.category = category projectObject.title = title projectObject.authenticity = False projectObject.put() self.response.headers.add_header("Set-Cookie", str("title=%s" % title)) sleep(5) self.redirect("/propose/project")
def post(self): count = int(self.request.get("count")) + 1 category = self.request.get("category") address = self.request.get("address") lat = self.request.get("lat") lng = self.request.get("lng") title = self.request.get("title") search = self.request.get("title").lower() link = title.replace(" ", "-") shortDescription = self.request.get("shortDescription") #date = time.strtftime("%Y-%m-%d %H:%M:%S") date = datetime.date.today() date = str(date) funding = [] print shortDescription user = users.get_current_user() userid = user.user_id() projectObject = Project() projectObject.ngo = userid projectObject.link = link projectObject.description = shortDescription projectObject.category = category projectObject.title = title projectObject.search = search projectObject.funding = funding projectObject.date = date projectObject.address = address projectObject.lat = lat projectObject.lng = lng projectObject.authenticity = False projectObject.tasks = [] j = 0 while j < count: Counter = str(j) taskTitle = self.request.get("taskTitle" + Counter) taskDescription = self.request.get("taskDescription" + Counter) taskFund = self.request.get("taskFund" + Counter) j = j + 1 projectObject.tasks.append([taskTitle, taskDescription, taskFund]) projectObject.put() self.response.headers.add_header("Set-Cookie", str("title=%s" % title)) sleep(5) self.redirect("/home")
def main(args): """ Parameters ---------- args: Array of arguments - arg[0] the user id - arg[1] the user choice of motif % kept Returns ------- object: json object Contain the tree build from RNA sequence """ print param = [] #Load the rna sequences try: os.chdir(os.path.join("..", "python", "src")) print os.getcwd() path = os.path.join(os.getcwd(), "results_" + args[0] + ".json") json_data = open(path).read() param.append(json.loads(json_data)) except: print "ERROR RECOVERING DATA" sys.exit(1) #user id param.append(args[0]) #Motif % param.append(args[1]) project = Project(param[0], param[1]) project.runSNM() project.buildTree(score="variance", percentage=param[2]) # Send it to stdout (to PHP) print json.dumps(project.tree.tree_format('json'))
def run(args): opts = Options() opts.parse(args[1:]) w = Project(opts) print w.welcome()
import sys from lib import Project from lib import Options if __name__ == '__main__': options = Options() opts, args = options.parse(sys.argv[1:]) v = Project(opts) v.date()
def setUp(self): self.machine = Project(self._default_options()) self.mock_process = MockProcess() self.machine.process = self.mock_process