Пример #1
0
    def createProjectLabel(self, parent, projInfo, color):
        frame = tk.Frame(parent, bg=color)
        # ROW1
        # Project name
        label = tk.Label(frame, text=projInfo.projName, anchor='nw', bg=color,
                         justify=tk.LEFT, font=self.projNameFont, cursor='hand1', width=50)
        label.grid(row=0, column=0,  padx=2, pady=2, sticky='nw')
        label.bind('<Button-1>', lambda e: self.openProject(projInfo.projName))

        # ROW2
        # Timestamp line
        dateMsg = '%s%s    %s%s' % (Message.LABEL_MODIFIED, prettyDate(projInfo.mTime),
                                    Message.LABEL_CREATED, prettyTime(projInfo.cTime, time=False))
        dateLabel = tk.Label(frame, text=dateMsg, font=self.projDateFont, bg=color)
        dateLabel.grid(row=1, column=0, sticky='nw')
        # Delete action
        delLabel = tk.Label(frame, text=Message.LABEL_DELETE_PROJECT, font=self.projDelFont, bg=color, cursor='hand1')
        delLabel.grid(row=1, column=1, padx=10)
        delLabel.bind('<Button-1>', lambda e: self.deleteProject(projInfo.projName))
        # Rename action
        mvLabel = tk.Label(frame, text=Message.LABEL_RENAME_PROJECT, font=self.projDelFont, bg=color, cursor='hand1')
        mvLabel.grid(row=1, column=2)
        mvLabel.bind('<Button-1>', lambda e: self.renameProject(projInfo.projName))

        # ROW3
        if projInfo.isLink:
            linkMsg = 'link --> ' + projInfo.linkedFolder
            lblLink = tk.Label(frame, text=linkMsg, font=self.projDateFont, bg=color, fg='grey', justify=tk.LEFT)
            lblLink.grid(row=2, column=0, columnspan=3, sticky='w')

        
        return frame
Пример #2
0
    def _doesProjectMatchFilter(self, project):
        """ Returns true if the project matches the filter"""
        # Lets' use the name anc creation date for now:
        searchString = "~".join([
            project.getName().lower(),
            prettyDate(project.mTime),
            prettyTime(project.cTime, time=False)
        ])

        return self.filter.get().lower() in searchString
Пример #3
0
 def createProjectLabel(self, parent, projInfo, color):
     frame = tk.Frame(parent, bg=color)
     label = tk.Label(frame, text=projInfo.projName, anchor='nw', bg=color, 
                      justify=tk.LEFT, font=self.projNameFont, cursor='hand1', width=50)
     label.grid(row=0, column=0,  padx=2, pady=2, sticky='nw')
     label.bind('<Button-1>', lambda e: self.openProject(projInfo.projName))
     dateMsg = '%s%s    %s%s' % (Message.LABEL_MODIFIED, prettyDate(projInfo.mTime),
                                 Message.LABEL_CREATED, prettyTime(projInfo.cTime, time=False))
     dateLabel = tk.Label(frame, text=dateMsg, font=self.projDateFont, bg=color)
     dateLabel.grid(row=1, column=0, sticky='nw')
     delLabel = tk.Label(frame, text=Message.LABEL_DELETE_PROJECT, font=self.projDelFont, bg=color, cursor='hand1')
     delLabel.grid(row=1, column=1, padx=10)
     delLabel.bind('<Button-1>', lambda e: self.deleteProject(projInfo.projName))
     mvLabel = tk.Label(frame, text=Message.LABEL_RENAME_PROJECT, font=self.projDelFont, bg=color, cursor='hand1')
     mvLabel.grid(row=1, column=2)
     mvLabel.bind('<Button-1>', lambda e: self.renameProject(projInfo.projName))
     
     return frame
Пример #4
0
def projects(request):
    from pyworkflow.utils.utils import prettyDate
    
    manager = Manager()
    projects = manager.listProjects()
    for p in projects:
        p.pTime = prettyDate(p.mTime)

    if 'projectName' in request.session: request.session['projectName'] = ""
    if 'projectPath' in request.session: request.session['projectPath'] = ""

    context = {'projects': projects,
               'projects_css': getResourceCss('projects'),
               'project_utils_js': getResourceJs('project_utils'),
               }
    
    context = base_grid(request, context)
    
    return render_to_response('projects.html', context)
Пример #5
0
def projects(request):
    from pyworkflow.utils.utils import prettyDate

    manager = Manager()
    projects = manager.listProjects()
    for p in projects:
        p.pTime = prettyDate(p.mTime)

    if 'projectName' in request.session: request.session['projectName'] = ""
    if 'projectPath' in request.session: request.session['projectPath'] = ""

    context = {
        'projects': projects,
        'projects_css': getResourceCss('projects'),
        'project_utils_js': getResourceJs('project_utils'),
    }

    context = base_grid(request, context)

    return render_to_response('projects.html', context)
Пример #6
0
    def createProjectLabel(self, parent, projInfo, color):
        frame = tk.Frame(parent, bg=color)
        label = tk.Label(frame,
                         text=projInfo.projName,
                         anchor='nw',
                         bg=color,
                         justify=tk.LEFT,
                         font=self.projNameFont,
                         cursor='hand1',
                         width=50)
        label.grid(row=0, column=0, padx=2, pady=2, sticky='nw')
        label.bind('<Button-1>', lambda e: self.openProject(projInfo.projName))
        dateMsg = '%s%s    %s%s' % (
            Message.LABEL_MODIFIED, prettyDate(projInfo.mTime),
            Message.LABEL_CREATED, prettyTime(projInfo.cTime, time=False))
        dateLabel = tk.Label(frame,
                             text=dateMsg,
                             font=self.projDateFont,
                             bg=color)
        dateLabel.grid(row=1, column=0, sticky='nw')
        delLabel = tk.Label(frame,
                            text=Message.LABEL_DELETE_PROJECT,
                            font=self.projDelFont,
                            bg=color,
                            cursor='hand1')
        delLabel.grid(row=1, column=1, padx=10)
        delLabel.bind('<Button-1>',
                      lambda e: self.deleteProject(projInfo.projName))
        mvLabel = tk.Label(frame,
                           text=Message.LABEL_RENAME_PROJECT,
                           font=self.projDelFont,
                           bg=color,
                           cursor='hand1')
        mvLabel.grid(row=1, column=2)
        mvLabel.bind('<Button-1>',
                     lambda e: self.renameProject(projInfo.projName))

        return frame
Пример #7
0
def projects(request):
    from pyworkflow.utils.utils import prettyDate

    manager = Manager()
    projectsList = manager.listProjects()
    for p in projectsList:
        p.pTime = prettyDate(p.mTime)

    if CTX_PROJECT_NAME in request.session:
        request.session[CTX_PROJECT_NAME] = ""
    if CTX_PROJECT_PATH in request.session:
        request.session[CTX_PROJECT_PATH] = ""

    context = {
        'projects': projectsList,
        'projects_css': getResourceCss('projects'),
        'project_utils_js': getResourceJs('project_utils'),
        'workflows': json.dumps(getWorkflowsList())
    }

    context = base_grid(request, context)

    return render_to_response('projects.html', context)