GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — python-github3/pygithub3/services/git_data/references.py at develop · dsc/python-github3 Expand file tree/ Copy pathreferences.pyMore file actions 84 lines (65 loc) · 2.62 KB / Copy pathreferences.pyFile metadata and controls84 lines (65 loc) · 2.62 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 #!/usr/bin/env python # -*- encoding: utf-8 -*- from pygithub3.services.base import Service class References(Service): """Consume `References API <http://developer.github.com/v3/git/refs/>`_""" def get(self, ref, user=None, repo=None): """ Get a reference :param str ref: The name of the reference to get :param str user: Username :param str repo: Repository .. note:: Remember :ref:`config precedence` .. note:: Remember that branch references look like "heads/<branch_name>" """ request = self.make_request('git_data.references.get', ref=ref, user=user, repo=repo) return self._get(request) def list(self, namespace='', user=None, repo=None): """ List all the references :param str namespace: Limit the request to a particular type of reference. For example, ``heads`` or ``tags``. :param str user: Username :param str repo: Repository :returns: A :doc:`result` .. note:: Remember :ref:`config precedence` """ request = self.make_request('git_data.references.list', user=user, repo=repo, namespace=namespace) return self._get_result(request) def create(self, data, user=None, repo=None): """ Create a reference :param dict data: Input. See `github refs doc`_ :param str user: Username :param str repo: Repository .. note:: Remember :ref:`config precedence` """ request = self.make_request('git_data.references.create', body=data, user=user, repo=repo) return self._post(request) def update(self, ref, data, user=None, repo=None): """ Update an existing reference :param str ref: The SHA of the reference to update :param dict data: Input. See `github refs doc`_ :param str user: Username :param str repo: Repository .. note:: Remember :ref:`config precedence` """ request = self.make_request('git_data.references.update', ref=ref, body=data, user=user, repo=repo) return self._patch(request) def delete(self, ref, user=None, repo=None): """Delete a reference :param str ref: The SHA of the reference to delete :param str user: Username :param str repo: Repository .. note:: Remember :ref:`config precedence` """ request = self.make_request('git_data.references.delete', ref=ref, user=user, repo=repo) return self._delete(request) |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |