예제 #1
0
    def iter(self, by=1):
        loaded = cmd.get_names('objects')[0]
        choices = self.choices()
        l = len(choices)
        next_file = 0
        next_file_index = 0
        for i in range(l):
            if objname(choices[i]) == loaded:
                next_file_index = (i + by) % l
                next_file = choices[(i + by) % l]
                break
        cmd.delete('all')
        if not os.path.exists(next_file):
            raise ValueError("Can not locate file: %s" % next)
        cmd.load(next_file)
        if self.auto_zoom:
            cmd.zoom()

        if self.onload_command:
            logging.debug("onload_command: %s", self.onload_command)
            cmd.do(self.onload_command)

        #cmd.replace_wizard('message',next_file)
        # to display current pdb index, start at 1
        cmd.replace_wizard(
            'message', next_file + ", %d/%d" %
            (next_file_index + 1, l))  # +1, so the cycler starts at 1
예제 #2
0
    def iter(self, by=1):
        #enabled = cmd.get_names('objects',enabled_only=1)[0]

        choices = self.choices()
        l = len(choices)

        assert self.current_index < l
        next_object = (self.current_index + by) % l

        cmd.disable(objname(choices[self.current_index]))

        self.current_index = next_object
        cmd.enable(objname(choices[self.current_index]))
        if self.auto_zoom:
            cmd.zoom(objname(choices[self.current_index]))

        if self.onload_command:
            logging.debug("onload_command: %s", self.onload_command)
            cmd.do(self.onload_command)

        cmd.replace_wizard('message', choices[self.current_index])
예제 #3
0
    def iter(self,by=1):
        loaded = cmd.get_names('objects')[0]
        choices = self.choices()
        l = len(choices)
        next_file = 0
        for i in range(l):
            if objname(choices[i]) == loaded:
                next_file = choices[ (i+by) % l ]
                break
        cmd.delete('all')
        if not os.path.exists(next_file):
            raise ValueError("Can not locate file: %s" % next)
        cmd.load(next_file)
        if self.auto_zoom:
            cmd.zoom()

        if self.onload_command:
            logging.debug("onload_command: %s", self.onload_command)
            cmd.do(self.onload_command)

        cmd.replace_wizard('message',next_file)
예제 #4
0
파일: Cycler.py 프로젝트: asford/pymol-home
    def iter(self,by=1):
        loaded = cmd.get_names('objects')[0]
        choices = self.choices()
        l = len(choices)
        next_file = 0
        for i in range(l):
            if objname(choices[i]) == loaded:
                next_file = choices[ (i+by) % l ]
                break
        cmd.delete('all')
        if not os.path.exists(next_file):
            raise ValueError("Can not locate file: %s" % next)
        cmd.load(next_file)
        if self.auto_zoom:
            cmd.zoom()

        if self.onload_command:
            logging.debug("onload_command: %s", self.onload_command)
            cmd.do(self.onload_command)

        cmd.replace_wizard('message',next_file)
예제 #5
0
파일: Cycler.py 프로젝트: asford/pymol-home
    def iter(self,by=1):
        #enabled = cmd.get_names('objects',enabled_only=1)[0]

        choices = self.choices()
        l = len(choices)

        assert self.current_index < l
        next_object = (self.current_index + by) % l

        cmd.disable(objname(choices[self.current_index]))

        self.current_index = next_object
        cmd.enable(objname(choices[self.current_index]))
        if self.auto_zoom:
            cmd.zoom(objname(choices[self.current_index]))

        if self.onload_command:
            logging.debug("onload_command: %s", self.onload_command)
            cmd.do(self.onload_command)

        cmd.replace_wizard('message',choices[self.current_index])