Exemple #1
0
    def _issue_from_args(cls, *args, **kwargs):

        kwargs = utils.args_to_kwargs(args, kwargs)

        if not kwargs.get("args") or len(kwargs.get("args")) == 0:
            kwargs["number"] = "new"
        else:
            kwargs["number"] = kwargs.get("args")[0]
            del kwargs["args"]

        key = "%s/%s" % (kwargs.get("repo"), kwargs.get("number"))
        if not i_hash.has_key(key):
            i_hash[key] = cls(**kwargs)
        return i_hash.get(key)
Exemple #2
0
    def show_issues(cls, *args, **kwargs):

        # normalize kwargs
        kwargs = utils.args_to_kwargs(args, kwargs)
        if not kwargs.get("repo"):
            kwargs["repo"] = github.repo_from_path()

        # case of now repo
        if not kwargs.get("repo") or not github.has_issues(kwargs.get("repo")):
            print "Unable to find repository. Please pass valid github uri or use from within a git directory"
            return

        # try to use cached il, if not, create a new one
        il = il_hash.get(kwargs.get("repo"))
        if not il or not utils.equal_dicts(il.kwargs, kwargs) and not kwargs.get("update"):
            il = cls(**kwargs)

        # update issue list
        il.update()