Ejemplo n.º 1
0
def setPeakFindParams(project, params):

    analysisProject = getAnalysisProject(project)

    for key in params.keys():
        keyword = keywordPrefix + upperFirst(key)
        value = params[key]
        setattr(analysisProject, keyword, value)
Ejemplo n.º 2
0
    def unsetLink(self, role):

        if (self.editMode):
            try:
                func = getattr(self.object,
                               'set%s' % upperFirst(role.baseName))
                func(None)
            except Implementation.ApiError, e:
                showError('Unsetting link', e.error_msg, parent=self)
Ejemplo n.º 3
0
def getPeakFindParams(project):

    params = {}
    analysisProject = getAnalysisProject(project)

    for key in peakFindKeys:
        keyword = keywordPrefix + upperFirst(key)
        value = getattr(analysisProject, keyword)
        params[key] = value

    return params
Ejemplo n.º 4
0
    def removeLink(self, table, role):

        selected = table.currentObject
        if (selected):
            if (self.editMode):
                try:
                    func = getattr(self.object,
                                   'remove%s' % upperFirst(role.baseName))
                    func(selected)
                except Implementation.ApiError, e:
                    showError('Removing link', e.error_msg, parent=self)
            else:
                self.creatorMap[role].remove(selected)
                self.setRoleValue(role)
Ejemplo n.º 5
0
def getAllObjects(top, metaclass):

    topClass = top.metaclass
    if (metaclass is topClass):
        return [top]

    clazz = metaclass
    while (clazz.parentRole.otherClass is not topClass):
        clazz = clazz.parentRole.otherClass

    func = getattr(top,
                   'findAll%s' % upperFirst(clazz.parentRole.otherRole.name))

    objs = func()
    allObjs = []
    for obj in objs:
        allObjs.extend(getAllObjects(obj, metaclass))

    return allObjs
Ejemplo n.º 6
0
    def addLink(self, role, clazz):

        if (self.editMode):
            root = self.object.root
        else:
            root = self.objParent.root

        popup = ObjectTablePopup(self, root, clazz, modal=True)
        selected = popup.selected
        popup.destroy()

        if (selected):
            if (self.editMode):
                try:
                    func = getattr(self.object,
                                   'add%s' % upperFirst(role.baseName))
                    func(selected)
                except Implementation.ApiError, e:
                    showError('Adding link', e.error_msg, parent=self)
            else:
                self.creatorMap[role.name].append(selected)
                self.setRoleValue(role)