Exemplo n.º 1
0
 def update_state_file(settings, state):
     Logger.debug('Update state file "{}"'.format(state.path))
     state.out = StateFile.parse_deps_state(settings,
                                            state.out,
                                            currdir=state.cwd)
     state.out_git = StateFile.parse_deps_state(settings,
                                                state.out_git,
                                                currdir=state.cwd)
     state.deps = StateFile.parse_deps_state(settings,
                                             state.deps,
                                             currdir=state.cwd)
     state.save()
Exemplo n.º 2
0
    def create_state_files(self, targets):
        """
        Create state files for all targets.
        """
        for data_item in targets:
            Logger.debug('Creating state file for {}'.format(
                data_item.data.relative))

            fname = os.path.basename(data_item.data.relative +
                                     StateFile.STATE_FILE_SUFFIX)
            out = StateFile.parse_deps_state(self.settings,
                                             [data_item.data.relative],
                                             currdir=os.path.curdir)
            state_file = StateFile(fname=fname,
                                   cmd=None,
                                   out=out,
                                   out_git=[],
                                   deps=[],
                                   locked=True)
            state_file.save()
            Logger.debug('State file "{}" was created'.format(
                data_item.state.relative))