Example #1
0
def open_progress(n, close_at_end=True, **kw):
    pd = myProgressDialog(max=n - 1,
                          close_at_end=close_at_end,
                          can_cancel=True,
                          can_ok=True, **kw)
    pd.open()
    return pd
Example #2
0
    def _build(self, branch, commit):

        # get the version number from version.py
        version = self._extract_version()

        pd = myProgressDialog(max=5200,
                              title='Builing Application. '
                                    'Version={} Branch={} ({})'.format(version, branch, commit.hexsha[:7]),
                              can_cancel=False)
        pd.open()
        pd.change_message('Building application')

        self.info('building application. version={}'.format(version))
        self.debug('building egg from {}'.format(self._repo.working_dir))

        dest = self._get_dest_root()
        self.debug('moving egg to {}'.format(dest))

        from pychron.updater.packager import make_egg, copy_resources

        pd.change_message('Building Application')
        with pd.stdout():
            make_egg(self._repo.working_dir, dest, 'pychron', version)
            # build egg and move into destination
            if dest.endswith('Contents'):
                make_egg(self._repo.working_dir, dest, 'pychron', version)

                self.debug('------------- egg complete ----------------')

            pd.change_message('Copying Resources')
            if dest.endswith('Contents'):
                copy_resources(self._repo.working_dir, dest, self.application.shortname)
            self.debug('------------- copy resources complete -----------')
Example #3
0
def open_progress(n, close_at_end=True, **kw):
    pd = myProgressDialog(max=n - 1,
                          #dialog_size=(0,0, 550, 15),
                          close_at_end=close_at_end,
                          can_cancel=True,
                          can_ok=True, **kw)
    pd.open()
    return pd
Example #4
0
 def load_progress(self, n):
     '''
     '''
     pd = myProgressDialog(max=n, message='Welcome',
                           size=(500, 50)
     )
     self.pd = pd
     self.pd.open()
    def _open_progress(self, n, close_at_end=True):

        pd = myProgressDialog(max=n - 1,
                              #dialog_size=(0,0, 550, 15),
                              close_at_end=close_at_end,
                              can_cancel=True,
                              can_ok=True)
        pd.open()
        # pd.on_trait_change(self._progress_closed, 'closed')
        return pd
Example #6
0
    def _open_progress(self, n, close_at_end=True):
        from pychron.core.ui.progress_dialog import myProgressDialog

        pd = myProgressDialog(max=n - 1,
                              close_at_end=close_at_end,
                              can_cancel=True,
                              can_ok=True)
        pd.open()
        # pd.on_trait_change(self._progress_closed, 'closed')
        return pd
Example #7
0
    def _open_progress(self, n, close_at_end=True):
        from pychron.core.ui.progress_dialog import myProgressDialog

        pd = myProgressDialog(max=n - 1,
                              close_at_end=close_at_end,
                              can_cancel=True,
                              can_ok=True)
        pd.open()
        # pd.on_trait_change(self._progress_closed, 'closed')
        return pd
Example #8
0
    def do_motor_initialization(self, name):
        if self.laser_controller:
            motor = self.laser_controller.get_motor(name)
            if motor is not None:
                n = 4
                from pychron.core.ui.progress_dialog import myProgressDialog

                pd = myProgressDialog(max=n, size=(550, 15))
                pd.open()
                motor.initialize(progress=pd)
                pd.close()
    def _open_progress(self, n, close_at_end=True):

        pd = myProgressDialog(
            max=n - 1,
            #dialog_size=(0,0, 550, 15),
            close_at_end=close_at_end,
            can_cancel=True,
            can_ok=True)
        pd.open()
        # pd.on_trait_change(self._progress_closed, 'closed')
        return pd
    def do_motor_initialization(self, name):
        if self.laser_controller:
            motor = self.laser_controller.get_motor(name)
            if motor is not None:
                n = 4
                from pychron.core.ui.progress_dialog import myProgressDialog

                pd = myProgressDialog(max=n, size=(550, 15))
                pd.open()
                motor.initialize(progress=pd)
                pd.close()
Example #11
0
    def _setup_progress(self, n):
        """
            n: int, initialize progress dialog with n steps

            return a myProgressDialog object
        """
        pd = myProgressDialog(max=n, message='Welcome',
                              position=(100, 100),
                              size=(500, 50))
        self._pd = pd
        self._pd.open()
        return pd
Example #12
0
def open_progress(n, close_at_end=True, busy=False, **kw):
    if busy:
        mi, ma = 0, 0
    else:
        mi, ma = 0, n - 1

    pd = myProgressDialog(min=mi, max=ma,
                          close_at_end=close_at_end,
                          can_cancel=True,
                          can_ok=True, **kw)
    pd.open()
    return pd
Example #13
0
    def _setup_progress(self, n):
        """
            n: int, initialize progress dialog with n steps

            return a myProgressDialog object
        """
        pd = myProgressDialog(max=n, message='Welcome',
                              position=(100, 100),
                              size=(500, 50))
        self.pd = pd
        self.pd.open()
        return pd
Example #14
0
    def apply_modified(self):
        if self.normal_k3739:
            v = None
        else:
            v = ufloat(self.k3739, self.k3739_err)
        ans = self.analyses
        pd = myProgressDialog(max=len(ans) - 1)
        pd.open()

        for ai in ans:
            pd.change_message('Modifying k3739 for {}'.format(ai.record_id))
            ai.fixed_k3739 = v
            ai.calculate_age(force=True)
        pd.close()

        self.dump()
Example #15
0
    def perform(self, event):
        from git import Repo
        from git.exc import InvalidGitRepositoryError
        from pychron.paths import paths
        remote = 'origin'
        branch = 'master'
        repos = []
        for d in os.listdir(paths.repository_dataset_dir):
            if d.startswith('.') or d.startswith('~'):
                continue

            try:
                r = Repo(repository_path(d))
            except InvalidGitRepositoryError:
                continue
            repos.append(r)

        n = len(repos)
        pd = myProgressDialog(max=n - 1, can_cancel=True, can_ok=False)
        pd.open()
        shared = False
        for r in repos:
            pd.change_message('Fetch {}'.format(os.path.basename(
                r.working_dir)))
            c = r.git.log('{}/{}..HEAD'.format(remote, branch), '--oneline')
            if c:

                r.git.pull()

                d = os.path.basename(r.working_dir)
                if confirm(None,
                           'Share changes made to {}.\n\n{}'.format(d,
                                                                    c)) == YES:
                    r.git.push(remote, branch)
                    shared = True

        msg = 'Changes successfully shared' if shared else 'No changes to share'
        information(None, msg)
Example #16
0
    def perform(self, event):
        from git import Repo
        from git.exc import InvalidGitRepositoryError
        from pychron.paths import paths
        remote = 'origin'
        branch = 'master'
        repos = []
        for d in os.listdir(paths.repository_dataset_dir):
            if d.startswith('.') or d.startswith('~'):
                continue

            try:
                r = Repo(repository_path(d))
            except InvalidGitRepositoryError:
                continue
            repos.append(r)

        n = len(repos)
        pd = myProgressDialog(max=n - 1,
                              can_cancel=True,
                              can_ok=False)
        pd.open()
        shared = False
        for r in repos:
            pd.change_message('Fetch {}'.format(os.path.basename(r.working_dir)))
            c = r.git.log('{}/{}..HEAD'.format(remote, branch), '--oneline')
            if c:

                r.git.pull()

                d = os.path.basename(r.working_dir)
                if confirm(None, 'Share changes made to {}.\n\n{}'.format(d, c)) == YES:
                    r.git.push(remote, branch)
                    shared = True

        msg = 'Changes successfully shared' if shared else 'No changes to share'
        information(None, msg)
Example #17
0
 def load_progress(self, n):
     '''
     '''
     pd = myProgressDialog(max=n, message='Welcome', size=(500, 50))
     self.pd = pd
     self.pd.open()
Example #18
0
    def _generate_queue_button_fired(self):
        pd = myProgressDialog()
        pd.open()

        ans = list(self._generate_runs_from_load()())
        self._gen_func(pd, ans)