コード例 #1
0
ファイル: command.py プロジェクト: gdetrez/bugwarrior
def pull(dry_run, flavor, interactive, debug):
    """ Pull down tasks from forges and add them to your taskwarrior tasks.

    Relies on configuration in bugwarriorrc
    """

    try:
        main_section = _get_section_name(flavor)
        config = _try_load_config(main_section, interactive)

        lockfile_path = os.path.join(get_data_path(config, main_section),
                                     'bugwarrior.lockfile')
        lockfile = PIDLockFile(lockfile_path)
        lockfile.acquire(timeout=10)
        try:
            # Get all the issues.  This can take a while.
            issue_generator = aggregate_issues(config, main_section, debug)

            # Stuff them in the taskwarrior db as necessary
            synchronize(issue_generator, config, main_section, dry_run)
        finally:
            lockfile.release()
    except LockTimeout:
        log.critical('Your taskrc repository is currently locked. '
                     'Remove the file at %s if you are sure no other '
                     'bugwarrior processes are currently running.' %
                     (lockfile_path))
    except RuntimeError as e:
        log.exception("Aborted (%s)" % e)
コード例 #2
0
ファイル: command.py プロジェクト: koobs/bugwarrior
def pull(dry_run, flavor):
    """ Pull down tasks from forges and add them to your taskwarrior tasks.

    Relies on configuration in bugwarriorrc
    """
    twiggy.quickSetup()
    try:
        main_section = _get_section_name(flavor)

        # Load our config file
        config = load_config(main_section)

        tw_config = TaskWarriorBase.load_config(get_taskrc_path(config, main_section))
        lockfile_path = os.path.join(os.path.expanduser(tw_config["data"]["location"]), "bugwarrior.lockfile")

        lockfile = PIDLockFile(lockfile_path)
        lockfile.acquire(timeout=10)
        try:
            # Get all the issues.  This can take a while.
            issue_generator = aggregate_issues(config, main_section)

            # Stuff them in the taskwarrior db as necessary
            synchronize(issue_generator, config, main_section, dry_run)
        finally:
            lockfile.release()
    except LockTimeout:
        log.name("command").critical(
            "Your taskrc repository is currently locked. "
            "Remove the file at %s if you are sure no other "
            "bugwarrior processes are currently running." % (lockfile_path)
        )
    except:
        log.name("command").trace("error").critical("oh noes")
コード例 #3
0
ファイル: command.py プロジェクト: ralphbean/bugwarrior
def pull(dry_run, flavor, interactive, debug):
    """ Pull down tasks from forges and add them to your taskwarrior tasks.

    Relies on configuration in bugwarriorrc
    """

    try:
        main_section = _get_section_name(flavor)
        config = _try_load_config(main_section, interactive)

        lockfile_path = os.path.join(get_data_path(config, main_section),
                                     'bugwarrior.lockfile')
        lockfile = PIDLockFile(lockfile_path)
        lockfile.acquire(timeout=10)
        try:
            # Get all the issues.  This can take a while.
            issue_generator = aggregate_issues(config, main_section, debug)

            # Stuff them in the taskwarrior db as necessary
            synchronize(issue_generator, config, main_section, dry_run)
        finally:
            lockfile.release()
    except LockTimeout:
        log.critical(
            'Your taskrc repository is currently locked. '
            'Remove the file at %s if you are sure no other '
            'bugwarrior processes are currently running.' % (
                lockfile_path
            )
        )
    except RuntimeError as e:
        log.critical("Aborted (%s)" % e)
コード例 #4
0
ファイル: command.py プロジェクト: mathstuf/bugwarrior
def pull():
    """ Pull down tasks from forges and add them to your taskwarrior tasks.

    Relies on configuration in ~/.bugwarriorrc
    """
    twiggy.quickSetup()
    try:
        # Load our config file
        config = load_config()

        tw_config = TaskWarriorBase.load_config(get_taskrc_path(config))
        lockfile_path = os.path.join(
            os.path.expanduser(tw_config['data']['location']),
            'bugwarrior.lockfile')

        lockfile = PIDLockFile(lockfile_path)
        lockfile.acquire(timeout=10)
        try:
            # Get all the issues.  This can take a while.
            issue_generator = aggregate_issues(config)

            # Stuff them in the taskwarrior db as necessary
            synchronize(issue_generator, config)
        finally:
            lockfile.release()
    except LockTimeout:
        log.name('command').critical(
            'Your taskrc repository is currently locked. '
            'Remove the file at %s if you are sure no other '
            'bugwarrior processes are currently running.' % (lockfile_path))
    except:
        log.name('command').trace('error').critical('oh noes')
コード例 #5
0
    def pull_issues(self):
        if not self.enabled:
            return False

        from .bugwarriorconfigrunlog import BugwarriorConfigRunLog
        log = BugwarriorConfigRunLog()
        log.config = self
        log.started = timezone.now()
        log.save()

        self.validate_configuration()

        try:
            issues = aggregate_issues(self.config, self.CONFIG_SECTION)

            with git_checkpoint(self.store, "Running bugwarrior-pull"):
                synchronize(
                    log,
                    issues,
                    self.config,
                    self.CONFIG_SECTION
                )
                self.store.sync()

            self.store.log_message(
                "Bugwarrior tasks were synchronized successfully: %s "
                "(Entry ID: %s)",
                log.output,
                log.pk,
            )
            self.store.publish_personal_announcement({
                'title': 'Bugwarrior',
                'message': 'Synchronization completed successfully.'
            })
            log.success = True
        except Exception as e:
            log.add_output("Issue synchronization failed: %s." % unicode(e))
            log.stack_trace = traceback.format_exc()
            log.success = False
            self.store.log_error(
                "An error was encountered while synchronizing bugwarrior: "
                "%s (Entry ID: %s)",
                log.error_message,
                log.pk,
            )
            self.store.publish_personal_announcement({
                'type': 'error',
                'title': 'Bugwarrior',
                'message': (
                    'An error was encountered while synchronizing with '
                    'bugwarrior; see your activity log for details.'
                )
            })

        log.finished = timezone.now()
        log.save()
コード例 #6
0
    def pull_issues(self):
        if not self.enabled:
            return False

        from .bugwarriorconfigrunlog import BugwarriorConfigRunLog
        log = BugwarriorConfigRunLog()
        log.config = self
        log.started = timezone.now()
        log.save()

        self.validate_configuration()

        try:
            issues = aggregate_issues(self.config, self.CONFIG_SECTION)

            with git_checkpoint(self.store, "Running bugwarrior-pull"):
                synchronize(log, issues, self.config, self.CONFIG_SECTION)
                self.store.sync()

            self.store.log_message(
                "Bugwarrior tasks were synchronized successfully: %s "
                "(Entry ID: %s)",
                log.output,
                log.pk,
            )
            self.store.publish_personal_announcement({
                'title':
                'Bugwarrior',
                'message':
                'Synchronization completed successfully.'
            })
            log.success = True
        except Exception as e:
            log.add_output("Issue synchronization failed: %s." % unicode(e))
            log.stack_trace = traceback.format_exc()
            log.success = False
            self.store.log_error(
                "An error was encountered while synchronizing bugwarrior: "
                "%s (Entry ID: %s)",
                log.error_message,
                log.pk,
            )
            self.store.publish_personal_announcement({
                'type':
                'error',
                'title':
                'Bugwarrior',
                'message':
                ('An error was encountered while synchronizing with '
                 'bugwarrior; see your activity log for details.')
            })

        log.finished = timezone.now()
        log.save()
コード例 #7
0
ファイル: command.py プロジェクト: pombredanne/bugwarrior
def pull():
    try:
        # Load our config file
        config = load_config()

        # Get all the issues.  This can take a while.
        issues = aggregate_issues(config)

        # Stuff them in the taskwarrior db as necessary
        synchronize(issues, config)
    except:
        log.name('command').trace('error').critical('oh noes')
コード例 #8
0
ファイル: command.py プロジェクト: gisce/bugwarrior
def pull():
    try:
        # Load our config file
        config = load_config()

        # Get all the issues.  This can take a while.
        issues = aggregate_issues(config)

        # Stuff them in the taskwarrior db as necessary
        synchronize(issues)
    except:
        log.trace("error").critical("oh noes")
コード例 #9
0
ファイル: command.py プロジェクト: djmitche/bugwarrior
def pull():
    """ Pull down tasks from forges and add them to your taskwarrior tasks.

    Relies on configuration in ~/.bugwarriorrc
    """
    twiggy.quickSetup()
    try:
        # Load our config file
        config = load_config()

        tw_config = TaskWarriorBase.load_config(get_taskrc_path(config))
        lockfile_path = os.path.join(
            os.path.expanduser(
                tw_config['data']['location']
            ),
            'bugwarrior.lockfile'
        )

        lockfile = PIDLockFile(lockfile_path)
        lockfile.acquire(timeout=10)
        try:
            # Get all the issues.  This can take a while.
            issue_generator = aggregate_issues(config)

            # Stuff them in the taskwarrior db as necessary
            synchronize(issue_generator, config)
        finally:
            lockfile.release()
    except LockTimeout:
        log.name('command').critical(
            'Your taskrc repository is currently locked. '
            'Remove the file at %s if you are sure no other '
            'bugwarrior processes are currently running.' % (
                lockfile_path
            )
        )
    except:
        log.name('command').trace('error').critical('oh noes')