示例#1
0
文件: review.py 项目: NMGRL/pychron
    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
文件: persist.py 项目: NMGRL/pychron
    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
文件: persist.py 项目: NMGRL/pychron
    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)