示例#1
0
    def launchFile(self):
        curSeq = self.list_seq.currentSelection()
        curShot = self.list_shot.currentSelection()
        if curSeq > -1:
            seq = self.sequences[curSeq]
            self.env.SEQ = seq

            if curShot > -1:
                shot = self.shots[curShot]
                self.env.SHOT = shot

                stage_data = self.currentStage()
                tag_data = 'None'

                curStage = stage_data[0]
                curApp = stage_data[1]
                app = core.Application(self.env, curApp, 1111)
                latest_file = app.getFile(stage=curStage)

                # If file is found
                if latest_file:
                    app.run()
                    return [seq, shot]

                # No file operations
                print 'No file found for %s-%s [Stage: %s, Tag: %s]' % (
                    self.env.SEQ,
                    self.env.SHOT,
                    curStage,
                    'None'
                )
                return [seq, shot]
            return [seq, None]
        return [None, None]
示例#2
0
 def test_as(self):
     app = core.Application()
     func = builtin.nameless.AsVariable()
     app.Variables.push(builtin.nameless.ImageReader().read(BultinImageTest.TMP_IMAGE_FILENAME))
     func.apply('@name', '@temp', -1)
     self.assertTrue('@name' in func.app.Variables)
     self.assertTrue('@temp' not in func.app.Variables)
示例#3
0
    def updateTags(self):
        stage_data = self.currentStage()

        curStage = stage_data[0]
        curApp = stage_data[1]

        tmpApp = core.Application(self.env, curApp, 1111)
        all_tags = tmpApp.tags(curStage)

        self.filter_tags.list.clear()
        for tag in all_tags:
            self.filter_tags.list.addItem(tag)
示例#4
0
    def updateModified(self):
        stage_data = self.currentStage()

        curStage = stage_data[0]
        curApp = stage_data[1]
        curTag = self.currentTag()

        tmpApp = core.Application(self.env, curApp, 1111)
        latest_file = tmpApp.getFile(stage=curStage, tag=curTag)
        if latest_file:
            modTime = tmpApp.getFileDate(latest_file)
            a = datetime.fromtimestamp(modTime).strftime("%Y-%m-%d %H:%M:%S")
            print 'Time: %s' % a
            self.label_ModifyDate.setText(a)
            return a

        self.label_ModifyDate.setText('No Recent File')
        return None
示例#5
0
文件: main.py 项目: elda27/cip
def main(args, debug=False):
    log.initialize()
    logger = log.getLogger('cip')
    if debug:
        root_logger = log.logging.getLogger()
        root_logger.setLevel('DEBUG')
        for h in root_logger.handlers:
            h.setLevel('DEBUG')
        logger.warning(
            'To display the verbose messages so the application performance maybe too bad.'
        )

    app = core.Application()
    if len(args) < 2:
        args.append('help:')

    logger.debug('Loaded modules are following: {}'.format(
        [m.getNamespace() for m in core.module.getModules()]))
    logger.debug(args)

    parser = arguments.ArgumentsParser()
    parser.parse(args[1:])
    tokens = parser.tokens()

    procedures = list()
    for token in tokens:
        logger.debug(token)
        proc = app.getProcedure(token.namespace(), token.operation())
        if proc is None:
            raise arguments.TokenError(token, 'A parsed token is not valid.')

        if '_Prior' in proc.__dict__ and proc._Prior:
            with proc() as p:
                logger.debug('Prior:{}'.format(proc))
                app.exec(p, token)
        else:
            procedures.append(proc)

    for proc, token in zip(procedures, tokens):
        with proc() as p:
            logger.debug(p)
            app.exec(p, token)