Пример #1
0
    def run(self, state):
        review = True
        if not self.auto_review:
            review = confirmation_dialog('Would you like to review before continuing?')

        if review:
            state.veto = self
Пример #2
0
    def run(self, state):
        review = True
        if not self.auto_review:
            review = confirmation_dialog(
                'Would you like to review before continuing?')

        if review:
            state.veto = self
Пример #3
0
    def run(self, state):
        p = os.path.join(paths.csv_data_dir, add_extension(self.pathname, '.csv'))

        with open(p, 'w') as wfile:
            writer = csv.writer(wfile)
            for ans in (state.unknowns, state.references):
                if ans:
                    header = self._get_header()
                    writer.writerow(header)
                    for ai in ans:
                        row = self._get_row(header, ai)
                        writer.writerow(row)

            if confirmation_dialog('File saved to {}\n\nWould you like to open?'.format(p)):
                view_file(p, application='Excel')
Пример #4
0
    def run(self, state):
        if state.saveable_irradiation_positions:
            xs = [x for x in state.saveable_irradiation_positions if x.save]
            if xs:
                self.dvc.meta_repo.smart_pull()

                progress_iterator(xs,
                                  lambda *args: self._save_j(state, *args),
                                  threshold=1)

                p = self.dvc.meta_repo.get_level_path(state.irradiation, state.level)
                self.dvc.meta_repo.add(p)
                self.dvc.meta_commit('fit flux for {}'.format(state.irradiation, state.level))

                if confirmation_dialog('Would you like to share your changes?'):
                    self.dvc.meta_repo.smart_pull()
                    self.dvc.meta_repo.push()
Пример #5
0
    def run(self, state):
        if state.saveable_irradiation_positions:
            xs = [x for x in state.saveable_irradiation_positions if x.save]
            if xs:
                self.dvc.meta_repo.smart_pull()

                progress_iterator(xs,
                                  lambda *args: self._save_j(state, *args),
                                  threshold=1)

                p = self.dvc.meta_repo.get_level_path(state.irradiation,
                                                      state.level)
                self.dvc.meta_repo.add(p, commit=False)
                self.dvc.meta_commit('fit flux for {}{}'.format(
                    state.irradiation, state.level))

                if confirmation_dialog(
                        'Would you like to share your changes?'):
                    self.dvc.meta_repo.smart_pull()
                    self.dvc.meta_repo.push()
Пример #6
0
 def confirmation_dialog(self, *args, **kw):
     return confirmation_dialog(*args, **kw)
Пример #7
0
 def confirmation_dialog(self, *args, **kw):
     return confirmation_dialog(*args, **kw)