How to use the stashy.compat.basestring function in stashy

To help you get started, we’ve selected a few stashy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cosmin / stashy / stashy / pullrequests.py View on Github external
def _make_ref(self, ref, refName="the ref"):
        if isinstance(ref, basestring):
            repo = self._parent.get()
            return PullRequestRef(repo['project']['key'], repo['slug'], ref).to_dict()
        elif isinstance(ref, PullRequestRef):
            return ref.to_dict()
        elif isinstance(ref, dict):
            return ref
        else:
            raise ValueError(refName + " should be either a string, a dict, or a PullRequestRef")
github cosmin / stashy / stashy / client.py View on Github external
def url(self, resource_path):
        assert isinstance(resource_path, basestring)
        if not resource_path.startswith("/"):
            resource_path = "/" + resource_path
        return self._api_base + resource_path