# Path: ghtools/api.py
# DEFAULT_GITHUB = 'public'


from collections import namedtuple
from ghtools.api import DEFAULT_GITHUB


_Identifier = namedtuple('Identifier', 'github org repo')

class Identifier(_Identifier):
    """

    A simple identifier of an object in the GitHub API, usually created from a
    string passed in on the command line.

    Users can reference a repository on a specific GitHub using the form::

        <github_name>:<org_name>/<repo_name>

    Where ``github_name`` is optional (defaulting to 'public').

    The repository can also be omitted in order to refer to an Organisation::

        <github_name>:<org_name>

    Again, ``github_name`` is optional.

    """

    @classmethod
    def from_string(cls, identstring):

        parts = identstring.split(':', 1)

        if len(parts) == 1:

# Path: ghtools/api.py
# DEFAULT_GITHUB = 'public'


# Path: ghtools/identifier.py
from collections import namedtuple
from ghtools.api import DEFAULT_GITHUB



_Identifier = namedtuple('Identifier', 'github org repo')

class Identifier(_Identifier):
    """

    A simple identifier of an object in the GitHub API, usually created from a
    string passed in on the command line.

    Users can reference a repository on a specific GitHub using the form::

        <github_name>:<org_name>/<repo_name>

    Where ``github_name`` is optional (defaulting to 'public').

    The repository can also be omitted in order to refer to an Organisation::

        <github_name>:<org_name>

    Again, ``github_name`` is optional.

    """

    @classmethod
    def from_string(cls, identstring):

        parts = identstring.split(':', 1)

        if len(parts) == 1:

            github = DEFAULT_GITHUB