asana_hub/action.py
def get_repo_and_project(self):
        """Returns repository and project."""
        app = self.app

        # Get repo
        repo = app.data.apply('github-repo', app.args.github_repo,
            app.prompt_repo,
            on_load=app.github.get_repo,
            on_save=lambda r: r.id
            )

        assert repo, "repository not found."

        # Get project
        project = app.data.apply('asana-project', app.args.asana_project,
            app.prompt_project,
            on_load=app.asana.projects.find_by_id,
            on_save=lambda p: p['id']
            )

        assert project, "project not found."

        # Set first issue
        first_issue = app.data.apply('first-issue', app.args.first_issue,
            "set the first issue to sync with [1 for new repos]",
            on_save=int)

        assert first_issue
        assert first_issue >= 0, "issue must be positive"

        app.sync_data()

        return repo, project
def get_repo_and_project(self):
        app = self.app

        # Get repo
        repo = app.data.apply('github-repo', app.args.github_repo,
            app.prompt_repo,
            on_load=app.github.get_repo,
            on_save=lambda r: r.id
            )

        assert repo, "repository not found."

        # Get project
        project = app.data.apply('asana-project', app.args.asana_project,
            app.prompt_project,
            on_load=app.asana.projects.find_by_id,
            on_save=lambda p: p['id']
            )

        assert project, "project not found."

        # Set first issue
        first_issue = app.data.apply('first-issue', app.args.first_issue,
            "set the first issue to sync with [1 for new repos]",
            on_save=int)

        assert first_issue
        assert first_issue >= 0, "issue must be positive"

        app.sync_data()

        return repo, project
def get_repo_and_project ( self ) : app = self . app # Get repo repo = app . data . apply ( 'github-repo' , app . args . github_repo , app . prompt_repo , on_load = app . github . get_repo , on_save = lambda r : r . id ) assert repo , "repository not found." # Get project project = app . data . apply ( 'asana-project' , app . args . asana_project , app . prompt_project , on_load = app . asana . projects . find_by_id , on_save = lambda p : p [ 'id' ] ) assert project , "project not found." # Set first issue first_issue = app . data . apply ( 'first-issue' , app . args . first_issue , "set the first issue to sync with [1 for new repos]" , on_save = int ) assert first_issue assert first_issue >= 0 , "issue must be positive" app . sync_data ( ) return repo , project
Returns repository and project.
Returns repository and project .