Beispiel #1
0
def tilesv2(table, numdim, outfile):
    ntable = project.project(table)
    tile = Tile()
    tile.tiny = 4 # the minimum instance num to assign a leaf
    tile.pre = ''
    tile.m = len(table.data[0])  # num of instances have
    tile.big = 2 * math.sqrt(tile.m)
    c1 = 1
    tile.watch = 1
    tile.centers = 'centroids'
    centable = {}  # dictinary to store all the splitted tables including the center table
    centable0 = tablestr.Table()
    reader.makeTable(ntable.name, centable0)
    centable[0] = centable0
    tiles0(ntable, tile)
    pre = tile.pre
    tiles4(1, tile.m, 1, tile.m, ntable, tile, centable, c1, pre, outfile)
    centable['project'] = ntable
    """
    x = centable[0].name.index('$_XX')
    y = centable[0].name.index('$_YY')
    maxvx = float(max(centable[0].data[x])); minvx = float(min(centable[0].data[x]))
    maxvy = float(max(centable[0].data[y])); minvy = float(min(centable[0].data[y]))
    for i in range(len(centable[0].data[0])):
        centable[0].data[x][i] = str('%4.8f'%((float(centable[0].data[x][i])  - minvx)/(maxvx - minvx)))
        centable[0].data[y][i] = str('%4.8f'%((float(centable[0].data[y][i])  - minvy)/(maxvy - minvy)))
    """
    return centable, len(centable[0].data[0])
Beispiel #2
0
    def __init__(self):
        self.s = starData()
        self.p = project()
        self.a = astronomy()
       
        pltCircle = 1.0 
        pltSize = pltSize = 1.1 * pltCircle
        pltLimit = pltCircle 

        pltStellarMagnitudeLimit = 4.8

        self.pltConstellationLines = 1
        self.pltNebula = 0
        self.pltConstellationBoundaries = 0
        self.pltConstellationLabels = 1
        self.pltEclipticLine = 1
        self.pltDecLines = 1
        self.pltRALines = 1
        self.pltDateCircle = 0

        # plot the Rete
        self.g = sg(-pltSize, pltSize, -pltSize, pltSize, pltLimit)
        self.g.setStarListIndex(pltStellarMagnitudeLimit)

        decMax = -23.5
        lat = 30 
        decMax = -90 + lat 
        rMax = pltLimit
        ptype = 3

        self.plotStarMap(ptype, decMax, rMax)
        self.g.endPlot("rete")
Beispiel #3
0
def __make_common_files(command_line, codegen_service):
    """Generate the files that are common to both the client and server."""
    # The first entry is the template.
    # The second entry is the name of the file being created.
    common_files = [[project(),           ".project"],
                    [properties(),        "project.properties"],
                    [AndroidManifest(),   "AndroidManifest.xml"],
                    [AndroidStrings(),    os.path.normpath("res/values/strings.xml")],
                    [AndroidLayoutMain(), os.path.normpath("res/layout/main.xml")],
                    [classpath(),         ".classpath"]
                   ]

    projects = ["Client"]

    if not command_line.client_only:
        projects.append("Service")

    for client_or_service_string in projects:
        for template, subfilename in common_files:
            template.client_or_service = client_or_service_string
            filename = os.path.join(client_or_service_string, subfilename)
            __make_target_file(template, filename, command_line, codegen_service)

    temp = ServiceMain()
    sub_path0 = "src"
    sub_path1 = __get_well_known_name_path(command_line)
    filename = os.path.join("Service", sub_path0, sub_path1, "ServiceMain.java")
    __make_target_file(temp, filename, command_line, codegen_service)

    temp = ClientMain()
    filename = os.path.join("Client", sub_path0, sub_path1, "ClientMain.java")
    __make_target_file(temp, filename, command_line, codegen_service)

    return
Beispiel #4
0
def openProject():
    cls()
    print(messeges['open_project'])
    objP = project(__sqlite)
    result = objP.get_list_proyect()
    selectTrue = False
    data_project = ''
    while not (selectTrue):
        headers = ('ID', 'NOMBRE', 'RUTA')
        tab = table(len(headers))
        tab.setMaxWidth(30)
        tab.setHeaders(headers)
        tab.setBody(result)
        tab.print_table()
        #for i in result:
        #    print(styles['result'].format(i))
        select_project = input(lines['input_option'])
        if select_project.isnumeric():
            select_project = int(select_project)
            for tupla in result:
                if select_project == tupla[0]:
                    selectTrue = True
                    objP = None
                    work_projec(tupla)
        else:
            print('Ingrese un valor valido, un ID')

    input('Salio')
Beispiel #5
0
def create_project():

  if 'email' not in session:
    return redirect(url_for('home'))

  show_project = ProjectForm()
  show_project.set_supervisor_choices()

  if request.method == 'POST':
    if show_project.validate() == False:
      flash('All fields are required.')
      return render_template('create_project.html', show_project=show_project)
    else:
      new_project = project(show_project, session['email'])
      db.session.add(new_project)
      db.session.commit()
      if show_project.file.data.filename:
        os.makedirs("Project/files/" + str(newuser.id))
        filename = secure_filename(show_project.file.data.filename)
        show_project.file.data.save('Project/files/' + str(newuser.id) + "/" + filename)
      flash('Project has been created')
      return redirect(url_for('create_project'))
 
  elif request.method == 'GET':
    return render_template('create_project.html', show_project=show_project) 
    def newProject(self):
        currproj = project.project()
        self.writeFilepath
        currproj.expr = self.inputExpr()
        currproj.colRef = self.inputColRef()
        currproj.createData(
            self.filepath,
            self.vars,
        )

        print("CSV Info")
        csv.info()
        print("Project Info")
        currproj.info()
Beispiel #7
0
 def returnAvailableProjects(self, uid):
     p = project()
     p.getAll()
     buf = "<select name='project' required>"
     for row in p.data:
         if str(row['id']) not in self.getProjectList(uid):
             if str(row['id']) == "9":
                 sel = "selected='true'"
             else:
                 sel = ""
             buf += "<option " + sel + " value='" + str(
                 row['id']) + "'>" + str(row['name']) + "</option>"
     buf += '''</select>'''
     return buf
Beispiel #8
0
 def returnProjectList(self, id):
     if self.data[0]['project'] == "":
         self.data[0]['project'] = "9"
     p = project()
     p.getAll("status DESC")
     buf = "<select name='project' id='assignmentProjectSelector'>"
     for row in p.data:
         if str(self.data[0]['project']) == str(row['id']):
             sel = 'selected="true"'
         else:
             sel = ""
         buf += "<option " + sel + " value='" + str(row['id']) + "'>" + str(
             row['name']) + "</option>"
     buf += "</select>"
     return buf
Beispiel #9
0
def listprojects(): 
    if checkSession(2):
        return redirect("/")

    session['lastPage'] = ''
    session['currentPage'] = "/projects"
    print session['lastPage']
    print session['currentPage']

    p = project()

    dmsg = ''

    if request.args.get('delete') in p.getListOfIds():
        id = request.args.get('delete')
        p.deleteById(id)
        dmsg = "Project has been deleted"

    html = '''<p style="color: green">''' + dmsg + '''</p>
    <a href="project/new">+ Create new project</a>
    <table style='width: 100%;' id='user_table'>
        <tr align="center" style="background-color: #2EB4ED; color: #EAEAEA; font-size: 1.13em">
            <td><b>Name</b></td>
            <td><b>Status</b></td>
        </tr>'''
        
    
    p.getAll('status DESC')
    if len(p.data) == 0:
        html = '''<p style="color: green">''' + dmsg + '''</p>
        <p>There are no projects to display</p>'''
    else:
        i = 0
        for row in p.data:
            c = "#2EB4ED"
            if i % 2 == 0:
                c = "#016C9B"
            html += '''
            <tr align="center" style="color: #EAEAEA; background-color:''' + c + '''">
                <td><a href="/project/''' + str(row['id']) +'''">''' + str(row['name']) + '''</a></td>
                <td>''' + p.returnStatus(str(row['status'])) +'''</td>
            </tr>'''
            i += 1
        html += '''
        </table>
        '''

    return header() + html + footer()
Beispiel #10
0
	def render(self):
		p = project.project(self.root, self.cols, self, self.scroll_lines + self.rows)
		self.lines = p.lines[self.scroll_lines:]
		self.arrows = self.complete_arrows(p.arrows)
		self.do_post_render_move_cursor()

		if False:#__debug__:  #todo: __debug__projection__ or something, this is eating quite some cpu i think and only checks the projection code (i think)
			assert(isinstance(self.lines, list))
			for l in self.lines:
				assert(isinstance(l, list))
				for i in l:
					assert(isinstance(i, tuple))
					assert(isinstance(i[0], unicode))
					assert(len(i[0]) == 1)
					assert(isinstance(i[1], dict))
					assert(i[1]['node'])
					assert('char_index' in i[1])
Beispiel #11
0
    def __init__(self):
        self.s = starData()
        self.p = project()
        self.a = astronomy()

        pltCircle = 1.0

        self.pltSize = 1.1 * pltCircle
        self.pltLimit = pltCircle
        self.pltStellarMagnitudeLimit = 4.8

        self.pltConstellationLines = 1
        self.pltNebula = 0
        self.pltConstellationBoundaries = 0
        self.pltConstellationLabels = 1
        self.pltEclipticLine = 1
        self.pltDecLines = 0
        self.pltRALines = 0
        self.pltDateCircle = 1

        self.starWheelRete = 1
        self.starWheelPlate = 2
        self.skymap = 3
        self.astrolabeReteStars = 4
        self.astrolabePlate = 5
        self.southernStarWheelRete = 6
        self.southernStarWheelPlate = 7
        lat = 53
        lon = 0
        #self.a.setLatLong(lat, lon)

        xx = self.starWheelPlate
        xx = self.starWheelPlate

        xx = self.starWheelRete
        self.createPlot(xx, lat)

        xx = self.starWheelPlate
        self.createPlot(xx, lat)

        xx = self.southernStarWheelRete
        #        self.createPlot(xx, lat)

        xx = self.southernStarWheelPlate
        self.createPlot(xx, lat)
Beispiel #12
0
  def test_add_Project(self):
    with app.test_request_context():
      form = ProjectForm()
      form.title.data = "This is a test"
      form.category.data = "Test"
      form.start_date.data = "2012-12-12"
      form.end_date.data = "2013-12-12"
      form.description.data = "This is a test"
      form.supervisor.data = "Test"

      new_project = project(form, "Test program")

      db.session.add(new_project)
      db.session.commit()

      fetchTestData = project.query.filter_by(title="This is a test").first()

      assert fetchTestData is not None
Beispiel #13
0
    def __init__(self):
        self.s = starData()
        self.p = project()
        self.a = astronomy()

        pltCircle = 1.0
        pltSize = pltSize = 1.1 * pltCircle
        pltLimit = pltCircle

        pltStellarMagnitudeLimit = 4.8

        self.pltConstellationLines = 1
        self.pltNebula = 0
        self.pltConstellationBoundaries = 0
        self.pltConstellationLabels = 1
        self.pltEclipticLine = 1
        self.pltDecLines = 1
        self.pltRALines = 1
        self.pltDateCircle = 1

        # plot the Rete
        self.g = sg(-pltSize, pltSize, -pltSize, pltSize, pltLimit)
        self.g.setStarListIndex(pltStellarMagnitudeLimit)

        decMax = -23.5
        lat = 40
        decMax = -90 + lat
        rMax = pltLimit
        ptype = 2  # plot type
        self.plotRete(ptype, decMax, rMax)
        self.g.endPlot("rete")

        #plot the Plate
        self.g = sg(-pltSize, pltSize, -pltSize, pltSize, pltLimit)
        hrotate = 18.
        #self.g.drawBoundingCircle( "red")
        self.plotHorizon(hrotate)
        self.g.plate()
        self.g.endPlot("plate")
Beispiel #14
0
def __make_common_files(command_line, codegen_service):
    """Generate the files that are common to both the client and server."""
    # The first entry is the template.
    # The second entry is the name of the file being created.
    common_files = [
        [project(), ".project"], [properties(), "project.properties"],
        [AndroidManifest(), "AndroidManifest.xml"],
        [AndroidStrings(),
         os.path.normpath("res/values/strings.xml")],
        [AndroidLayoutMain(),
         os.path.normpath("res/layout/main.xml")], [classpath(), ".classpath"]
    ]

    projects = ["Client"]

    if not command_line.client_only:
        projects.append("Service")

    for client_or_service_string in projects:
        for template, subfilename in common_files:
            template.client_or_service = client_or_service_string
            filename = os.path.join(client_or_service_string, subfilename)
            __make_target_file(template, filename, command_line,
                               codegen_service)

    temp = ServiceMain()
    sub_path0 = "src"
    sub_path1 = __get_well_known_name_path(command_line)
    filename = os.path.join("Service", sub_path0, sub_path1,
                            "ServiceMain.java")
    __make_target_file(temp, filename, command_line, codegen_service)

    temp = ClientMain()
    filename = os.path.join("Client", sub_path0, sub_path1, "ClientMain.java")
    __make_target_file(temp, filename, command_line, codegen_service)

    return
Beispiel #15
0
def main():
	data_from_pickle = 0
	projection_from_pickle = 1
	clusters_from_pickle = 1

	if data_from_pickle:
		uber_df, street_df, street_graph, node_coord_dict, coord_node_dict, \
			edge_dict, coord_lookup, transition_graph, trans_edge_dict, \
			edge_trans_dict, trans_dict = load_data.from_pickle()
	else:
		uber_df, street_df, street_graph, node_coord_dict, coord_node_dict, \
			edge_dict, coord_lookup, transition_graph, trans_edge_dict, \
			edge_trans_dict, trans_dict = load_data.load_fresh()

	''' apply Kalman filter first pass here, fix large errors '''

	if projection_from_pickle:
		print 'reading in projected uber_df from pickle...'
		uber_df = pickle.load(open('../pickles/uber_df_projected.pkl'))
		print 'read projected uber_df'
	else:
		uber_df = project.project(uber_df, street_graph, transition_graph, 
			node_coord_dict, edge_dict, edge_trans_dict, coord_lookup)
		pickle.dump(uber_df, open('../pickles/uber_df_projected.pkl','wb'))

	''' apply Kalman filter second pass here? fix small errors and re-project onto edges? '''

	if clusters_from_pickle:
		uber_df, centroids = cluster.from_pickle()
	else:
		uber_df, centroids = cluster.cluster(uber_df)

	transition_graph = cluster_graphs.preadjust_transweights(uber_df, edge_dict, transition_graph)
	pickle.dump(transition_graph, open('../pickles/transition_graph_update.pkl','wb'))
	cgraphs = cluster_graphs.make_cluster_graphs(centroids, 
		transition_graph, uber_df, edge_dict)
	pickle.dump(cgraphs, open('../pickles/cgraphs.pkl','wb'))
Beispiel #16
0
            if bam0.checkindex()==0:
                bam0.buildindex()
            bam0.Tobdg(ts)
            bam0.Tojun(ts)
            
            jun0=junctionfile.junFile(junfilename,[cfg.pathucsctools,cfg.chromszfile])
            jun0.Tobigbed(annochrjuncdict)
            jun0.buildindex()
            
            bdg0=bedgraph.bdgFile(bdgfilename,[cfg.pathucsctools,cfg.chromszfile])
            bdg0.Tobigwig() 
            bdg0.buildindex()             
        

    #if max(cfg.run_splice_collate_flag,cfg.run_proj_act_flag,cfg.run_extract_flows,cfg.run_cluster_flag,cfg.run_fdm_fast_flag,cfg.run_fdm_full_flag)==1:
    prj0=project.project(cfg,gtffile)
        
    if cfg.run_splice_collate_flag>=1:
        run_name='p2'
        prj0.setprojmetadict(cfg.run_splice_collate_flag)
        
    # ACT
    if cfg.run_proj_act_flag==1:
        if len(cfg.act_run_list)==1:
            run_name='p3.%s'%cfg.act_run_list[0]
        else:
            run_name='p3'
        message='Creating ACT graphs for %s'%str(cfg.act_run_list)
        common.printstatus(message,'S',common.func_name())
        #islandlist=islandlist[0:30]
        for ts in cfg.act_run_list:
Beispiel #17
0
def work_project(tupla):
    cls()
    objP = project(__sqlite)
    #tupla esta armado por 0=id, 1=name 2=path
    objP.work_project(tupla[0], tupla[1], tupla[2])
Beispiel #18
0
def makeProject():
    objP = project(__sqlite)
    name_p = input(lines['name_project'])
    objP.create_project(name_p)
    objP.create_init_install()
Beispiel #19
0
from project import project
v = project("/tmp/pr/prj.txt", "/tmp/pr/", 443, "https", 2, "/tmp/pr/db.db", 2,
            "desktop", "/usr/local/bin/phantomjs", "/tmp/pr/screen.js")
v.save_to_db = True
v.start()
Beispiel #20
0
            return False
        return True

    # def center_on_the_screen(self):
    #     ag = QDesktopWidget().availableGeometry()
    #     sg = QDesktopWidget().screenGeometry()
    #
    #     widget = self.geometry()
    #     x = ag.width() - widget.width()
    #     y = 2 * ag.height() - sg.height() - widget.height()
    #     self.move(x, y)

mypath = "."
my_data = data.data
opt = options.options()
proj = project.project()
opt.readOptions(proj)
print("Project=" + opt.currentProject)
# print("WindowRect=" + opt.windowRect)
if opt.currentProject != "":
    # proj.readProject(opt.currentProject)
    # print("read project " + opt.currentProject)
    print("current ref=" + proj.currentBook + " " + str(proj.currentChapter))
# opt.writeOptions()
projectfiles = [f[:len(f)-4] for f in listdir(mypath) if isfile(join(mypath, f)) and f.endswith(".prj")]
print(projectfiles)

app = QApplication(sys.argv)
mainWindow = Ui_MainWindow()
mainWindow.setCurrentProjectName(opt.currentProject)
mainWindow.show()
Beispiel #21
0
def proj():
	import project
	project.project()
Beispiel #22
0
from project import project, task_status
from projectlist import ProjectList

projects_directory = './TestProjecten/'

myprojlist = ProjectList(projects_directory)

p = project('testproject', 3)
p._priority = 100000
p.add_task('Plan opstellen', 'eerste voorstel schrijven')
p.add_workpackage('Plan opstellen')
p.add_workpackage('Plan uitvoeren')
p.add_workpackage('Plan nabespreken')
p.insert_workpackage('team samenstellen', 2)
p.add_workpackage('Financiering regelen')
p.repos_workpackage('Financiering regelen', 1)

p.add_task('Plan opstellen', 'eerste voorstel schrijven')
p.add_task('Plan opstellen', 'eerste voorstel schrijven')
p.add_task('Plan opstellen', 'commentaar verwerken')
p.add_task('Financiering regelen', 'Bedelen op straathoek')
p.remove_task('Plan opstellen', 'eerste voorstel schrijven')
p.remove_task('Plan opstellen', 'sedfsvs')
p.add_task('team samenstellen', 'aertf')
p.remove_workpackage('team samenstellen')
myprojlist.save_project(p)
p.print()

p2 = project('oud project', 2)
p2.add_workpackage('plan opstellen')
p2.add_workpackage('groep verzamelen')
Beispiel #23
0
    def __init__(self, xmin, xmax, ymin, ymax, rmax):

        figureSize = 10.5
        #figureSize = 6
        aspectratio = 0
        margin = 0.25
        self.xmin = xmin
        self.xmax = xmax
        self.ymin = ymin
        self.ymax = ymax
        self.Rmax = rmax

        self.p = project()
        self.a = astronomy()

        self.mapColor = "white"
        self.mapCircleColor = "black"
        self.decCircleColor = "black"
        self.raCircleColor = "black"
        self.plateCircleColor = "black"
        self.plateFontColor = "white"
        self.plateFontSize = "12"
        self.horizonLineColor = "black"
        self.starColor = "black"
        self.constellationLineColor = "black"
        self.constellationBoundaryColor = "red"
        self.starColor = "blue"
        self.starColor = "black"

        fig = plt.figure(figsize=(figureSize, figureSize))
        fig.patch.set_facecolor(self.mapColor)
        self.ax = fig.add_subplot(111)  #,aspect='equal')

        self.ax.get_xaxis().set_visible(False)
        self.ax.get_yaxis().set_visible(False)
        #ax.set_frame_on(False)
        #self.ax.set_frame_on(True)
        self.ax.set_frame_on(False)

        plt.xlim(xmin, xmax)
        plt.ylim(ymin, ymax)
        plt.tight_layout()

        #        circle1 = plt.Circle( (0,0), self.Rmax, color=self.mapCircleColor, fill=False)
        #        self.ax.add_artist(circle1)

        dr = 0.05
        rr = self.Rmax + dr
        #circle1 = plt.Circle( (0,0), rr, color=self.mapCircleColor, fill=False)
        #self.ax.add_artist(circle1)

        circle1 = plt.Circle((0, 0),
                             rr - dr,
                             color=self.mapCircleColor,
                             fill=False)
        self.ax.add_artist(circle1)

        circle1 = plt.Circle((0, 0),
                             rr + dr,
                             color=self.mapCircleColor,
                             fill=False)
        self.ax.add_artist(circle1)
Beispiel #24
0
 def __init__(self, project_folder):
     self.proj = project(project_folder)
     self.sql = sql_manager(self.proj)
     self.data = data_manager(self.sql)
     self.model = model_manager(self.sql)
Beispiel #25
0
                bam0.buildindex()
            bam0.Tobdg(ts)
            bam0.Tojun(ts)

            jun0 = junctionfile.junFile(junfilename,
                                        [cfg.pathucsctools, cfg.chromszfile])
            jun0.Tobigbed(annochrjuncdict)
            jun0.buildindex()

            bdg0 = bedgraph.bdgFile(bdgfilename,
                                    [cfg.pathucsctools, cfg.chromszfile])
            bdg0.Tobigwig()
            bdg0.buildindex()

    #if max(cfg.run_splice_collate_flag,cfg.run_proj_act_flag,cfg.run_extract_flows,cfg.run_cluster_flag,cfg.run_fdm_fast_flag,cfg.run_fdm_full_flag)==1:
    prj0 = project.project(cfg, gtffile)

    if cfg.run_splice_collate_flag >= 1:
        run_name = 'p2'
        prj0.setprojmetadict(cfg.run_splice_collate_flag)

    # ACT
    if cfg.run_proj_act_flag == 1:
        if len(cfg.act_run_list) == 1:
            run_name = 'p3.%s' % cfg.act_run_list[0]
        else:
            run_name = 'p3'
        message = 'Creating ACT graphs for %s' % str(cfg.act_run_list)
        common.printstatus(message, 'S', common.func_name())
        #islandlist=islandlist[0:30]
        for ts in cfg.act_run_list:
Beispiel #26
0
def edit_project(pid):
    if checkSession(3):
        return redirect("/")

    if session['currentPage'] != "/project/" + pid:
        session['lastPage'] += ", " + session['currentPage']
    session['currentPage'] = "/project/" + pid
    print session['lastPage']
    print session['currentPage']

    p = project()
    emsg = ''
    teamMsg = ''
    assignMsg = ''

    assignmentSel = request.args.get('assignmentSelector')
    if assignmentSel == None:
        assignmentSel = 0

    if request.args.get('action') == 'update':
        p.getById(pid)
        p.data[0]['name'] = request.form.get('name')
        p.data[0]['description'] = request.form.get('description')
        p.data[0]['status'] = request.form.get('status')
        if 'logo' in request.files:
            p.data[0]['logo'] = request.files['logo'].filename
        if p.verify_update():
            p.update()
            if 'logo' in request.files:
                file_save = logos.save(request.files['logo'])
            emsg = "<p style='color:green'>Project updated.</p>"
        else:
            emsg = "<p style='color:red'>" + p.getErrorHTML() + "</p>"
    if request.args.get('action') == 'insert':
        p.createBlank()
        p.data[0]['name'] = request.form.get('name')
        p.data[0]['description'] = request.form.get('description')
        p.data[0]['status'] = request.form.get('status')
        if ('logo' in request.files):
            filename = logos.save(request.files['logo'])
            p.data[0]['logo'] = filename
        if p.verify_new():
            p.insert()
            emsg = '<p style="color:green">Project added.</p>'
        else:
            emsg = "<p style='color:red'>" + p.getErrorHTML() + "</p>"
    if request.args.get('team') == 'add':
        t = team()
        t.createBlank()
        t.data[0]['user'] = request.form.get('user')
        t.data[0]['position'] = request.form.get('position')
        t.data[0]['project'] = pid
        print t.data
        if t.verify_new(pid):
            print t.data
            t.insert()
            teamMsg = '<p style="color: green; margin-bottom: 1em">User Added</p>'
        else:
            teamMsg = '<p style="color: red; margin-bottom: 1em">' + t.getErrorHTML() + "</p>"
    if request.args.get('team') == 'remove':
        t = team()
        t.deleteByUser(request.form.get('user'), pid)
        teamMsg = '<p style="color: green; margin-bottom: 1em">' + t.returnUserName(request.form.get('user')) + " has been removed from this project</p>"
    if request.args.get('assignment') == "add":
        a = assignment()
        a.createBlank()
        a.data[0]['title'] = request.form.get('title')
        a.data[0]['description'] = request.form.get('description')
        a.data[0]['assignedTo'] = request.form.get('user')
        a.data[0]['dueDate'] = request.form.get('dueDate')
        a.data[0]['project'] = pid
        if a.verify_new():
            a.insert()
            assignMsg = '<p style="color: green; margin-bottom: 1em">Assignment Added</p>'
        else:
            assignMsg = '<p style="color: red; margin-bottom: 1em">' + a.getErrorHTML() + "</p>"
    if request.args.get('back') == "true":
        updatePath()

    if pid == 'new':
        p.createBlank()
        w = 'Add New Project'
        act = 'insert'
        hide = "display: none"
        col1 = "col-sm-4"
        col3 = "<div class='col-sm-4'></div>"
        cta = "Add Project"
    else:
        p.getById(pid)
        w = 'Project Information'
        act = 'update'
        hide = ""
        col1 = "col-sm-8"
        col3 = ""
        cta = "Update Project"
    if p.data[0]['logo'] == '':
        src = ""
    else:
        src = "src='../static/Images/" + p.data[0]['logo'] + "'"

    html = '''<div class="row">
    <div class="col-sm-2">
        <form id="backFunction" action="''' + goBack() + '''?back=true" method="POST">
                <input type="submit" class="button-secondary" value="Back">
        </form>
    </div>
    <div class="col-sm-8">
        <h1 id="user_title_main" align="center" style="''' + hide +'''">''' + p.data[0]['name'].upper() + '''</h1>
    </div>
    <div class="col-sm-2"></div>
    </div>
    <div class='row'>
    <div class="''' + col1 + '''">
        <h2 style="''' + hide +'''">Team</h2>''' + teamMsg + '''
        <div style="''' + hide + '''" id="projectTeam">'''
    
    t = team()
    html += t.getTeam(pid)

    html += '''</div>
        <h2 style="''' + hide +'''">Assignments</h2>
        <div style="''' + hide + '''" id="projectAssignments">'''

    a = assignment()
    html += a.getProjectAssignments(pid, assignmentSel)

    html += '''
        </div>
        </div>
        <div align='center' class='col-sm-4'>
        <h2 id='user_form_title'>''' + w + '''</h2>''' + emsg + '''
        <form align='left' enctype="multipart/form-data" id='project_form' action="/project/''' + str(pid) + '''?action=''' + act + '''" method="POST">
            <p class='labels'>Name</p>
            <input name="name" required type="text" value="''' + p.data[0]['name'] + '''"/><br/>
            <p class='labels'>Description</p>
            <textarea name="description" style="width:100%; height: 12em" required form="project_form">''' + p.data[0]['description'] + '''</textarea>
            <p class='labels'>Status</p>''' + p.getStatusMenu() + '''
            <p class='labels'>Logo</p>
            <img id="project_logo" ''' + src + '''/><br/>
            <input name="logo" type="file" accept="image/*"/ value="''' + p.data[0]['logo'] + '''">
            <br>

            <input type="submit" class='button-primary' value="''' + cta + '''"/>

        </form>
        <a href="/projects?delete=''' + pid + '''" onclick="return confirm('Are you sure you want to delete ''' + p.data[0]['name'] + '''?');" style="color: #C2C2C2; font-size: 80%; ''' + hide + '''">Delete Project</a>
        </div>''' + col3 + '''
        </div>

        '''
    return header() + html + footer()
Beispiel #27
0
	def project(s):
		s.lines = project.project(s, # calls back our tags()
		    s.cols, s,
		    s.scroll_lines + s.rows  # bottom cut off
		).lines[s.scroll_lines:] # top cut off
Beispiel #28
0
 def CreateNewProject(self, projectname, projectCode):
     self.project = project(projectname, projectCode)
 def get_project_byname(self, name):
     newproject = project()
     project_series = self._project_list.loc[self._project_list.name ==
                                             name].iloc[0]
     newproject._load_from_series(self._directory, project_series.iloc[0])
     return newproject
Beispiel #30
0
from project import project

p=proxy()
# Make proxylist
p.get_proxy_premium()

#f=phantom()
#THREADS = 100



#def worker():
#    """@todo: Docstring for target.
#    :returns: @todo
#
#    """
#    f.walk_forever('svkvisa')

#if __name__ == '__main__':
#    jobs = []
#    for i in range(7):
#        p = Process(target=worker)
#        jobs.append(p)
#        p.start()

if __name__ == '__main__':
    prj=project()
    prj.run_all()


Beispiel #31
0
    def getProjectAssignments(self, id, s):
        if id == "new":
            return ""
        self.data = []
        p = project()
        t = team()
        p.getById(id)
        msg = ''

        if str(s) == "2":
            self.getAllByProject(id)
            msg = '''<p>''' + p.data[0][
                'name'] + ''' does not have any assignments</p>'''
        elif str(s) == "0":
            self.getIncompleteByProject(id)
            msg = '''<p>''' + p.data[0][
                'name'] + ''' does not have any incomplete assignments</p>'''
        elif str(s) == "1":
            self.getCompleteByProject(id)
            msg = '''<p>''' + p.data[0][
                'name'] + ''' has not completed an assignment</p>'''

        html = '''
            <div class="row">
                <div class="col-sm-0"></div>
                <div class="col-sm-4">
                    <form id="assignmentToggle" action="/project/''' + str(
            p.data[0]['id']) + '''" method="GET">'''

        html += self.returnAssignmentSelector()

        html += '''
                    </form>
                </div>
                <div class="col-sm-8"></div>
            </div>
        '''

        if len(self.data) == 0:
            html += msg
        else:
            i = 0
            html += '''
                <table style="width:100%" id="user_table">
                <tr align="left" style="background-color:#2EB4ED; color:#EAEAEA; font-size: 1.13em;">
                    <td><b>Assignment<b></td>
                    <td><b>Assigned To</b></td>
                    <td><b>Due Date</b></td>
                </tr>
            '''
            for row in self.data:
                c = '#2EB4ED'
                if i % 2 == 0:
                    c = '#016C9B'
                html += '''<tr style="background-color:''' + c + '''; color:#EAEAEA">
                    <td><a href="../assignment/''' + str(
                    row['id']) + '''">''' + row['title'] + '''</a></td>
                    <td><a href="../user/''' + str(
                        row['assignedTo']) + '''">''' + self.returnUserName(
                            row['assignedTo']) + '''</a></td>
                    <td>''' + str(row['dueDate']) + '''</td>
                </tr>'''
                i += 1
            html += "</table>"

        html += '''
        <div class="row" style="margin-top: 2em" align="center">
            <div class="col-sm-1"></div>
            <div class="col-sm-3">
                <p class="button-primary" id="addAssignmentButton" onclick="toggleAddAssignment()">Create Assignment</p>
            </div>
            <div class="col-sm-1"></div>
            <div class="col-sm-3"></div>
            <div class="col-sm-4"></div>
        </div>

        '''

        html += '''<div class="row" id="assignmentForm">
                <div class="col-sm-1"></div>
                <form id="addAssignment" action="/project/''' + str(
            p.data[0]
            ['id']) + '''?assignment=add" method="POST" class="col-sm-5">
                    <p class="labels">Title</p>
                    <input type="text" required name="title">
                    <p class="labels">Description</p>
                    <textarea style="height: 10em; width: 100%;" name="description" form="addAssignment"></textarea>
                    <p class="labels">User</p>''' + t.returnTeamList(
                p.data[0]['id']) + '''
                    <p class="labels">Due Date</p>
                    <input type="text" id="datepicker" required name="dueDate"/>
                    <br><br>
                    <input type="submit" value="Create" class="button-primary"/>
                </form>
                <div class="col-sm-6"></div>
            </div>'''
        return html
Beispiel #32
0
 def returnProjectName(self, pid):
     p = project()
     p.getById(pid)
     return p.data[0]['name']
Beispiel #33
0
A = R.dot(Ab.dot(R.T))
Bb = Q.T.dot(BL.dot(Q))
B = R.dot(Bb.dot(R.T))
x = R.dot(xb)
y = R.dot(yb)

J0 = get_J0(x, y)
n, ncuts = J0.shape

rr = x ** 2 + y ** 2
uex = 1.0 - rr
f = 4 * B.dot(np.ones((n,)))

tol = 1e-8
prec = 0  # Jacobi
u, res, n_iter = project(f, A, J0, tol, prec, verbose=0)

prec = 1  # V-cycle
u_mg, res_mg, n_iter_mg = project(f, A, J0, tol, prec, verbose=0)

itr = np.arange(0, n_iter + 1)
itr_mg = np.arange(0, n_iter_mg + 1)

ub = (R.T).dot(u)

plt.figure()
ax = plt.axes(projection="3d")
ax.plot_trisurf(xb, yb, ub * 0, triangles=tri)
ax.scatter(x, y, 10 * (u - uex), c="r", marker="o")
# Essentially the same error
# ax.scatter(x, y, 10*(u_mg-uex), c="g", marker="o")