Commit Graph
12 Commits
Author SHA1 Message Date
Justin Kufro a433a2fe3d Traffic Endpoints Support (#977)
Added support for the traffic endpoints found at https://developer.github.com/v3/repos/traffic/.

We added four functions to the Repository class (one for each of the endpoints) with corresponding unit tests. 

Fixes #926
2018-12-05 09:54:31 +08:00
Alice GIRARD 0a10d7cdf0 Mark notification as read (#932)
Wraps the parts of the notification API that allows the user to mark notifications as read.
New methods are : 
 
- Notification.mark_as_read : marks a single notification thread as read
- Repository.mark_notifications_as_read : marks all the notifications for a given repository as read
- AuthenticatedUser.mark_notifications_as_read : marks all the notifications as read

Aims to fix : https://github.com/PyGithub/PyGithub/issues/571 and simply uses the APIs described on this page : https://developer.github.com/enterprise/11.10.340/v3/activity/notifications/

A weird thing I noticed doing this is that Repository.notifications_url doesn't seem to be usable directly. I used Repository.url + "/notifications" instead.
2018-10-19 07:24:45 +08:00
Steve Kowalik 2b2ecfad4d Add some examples for Branch (#936)
In the spirit of #874, add some examples for working with Branch
objects. It doesn't add everything, but it's a start.
2018-10-18 19:41:59 +08:00
Juri Di Rocco 5e69ff00a3 Update Repository.rst (#935)
stargazers count attribute  is misspelled
2018-10-17 17:00:42 +08:00
AetherDeity ee9f098d91 Add a trailing slash to URL when updating or deleting a file (tests fixed) (#931)
* Add a trailing slash to URL when updating or deleting a file.

* Update test files to match new create/update/delete_file Repo methods

* Add trailing slash to get_contents() method

* update tests

* add missing slash in get_dir_contents

* add example usage

* remove dup slashes in tests

* clarify example comments
2018-10-17 08:21:17 +08:00
Levi Matus 9d2129c7b9 Example: Listen for New Events with PyGithub and Pyramid (#930)
## What does this change do?
Adds a small demo implementation of how one might use webhooks to listen for
new events in a given repository.

### Additions
#### doc/examples/Webhook.rst
Adds a new `.rst` file, `Webhook.rst`, which can be used for demonstrating the usage of Webhooks in PyGithub.

The example that I've added shows how to continually listen for events using Pyramid in conjunction with PyGithub.

## Motivation
This example is in the spirit of #874. [It was asked](https://github.com/PyGithub/PyGithub/issues/874#issuecomment-429075695) that someone provide an example of how to listen to events from a repository.

## How has this been tested?
I've built the docs locally and made sure the HTML is generated as expected.

## Screenshots
![webhook1](https://user-images.githubusercontent.com/16039329/46991191-40e58900-d0db-11e8-87e4-d5cf2cc18b0a.png)
![webhook2](https://user-images.githubusercontent.com/16039329/46991193-42af4c80-d0db-11e8-9b20-678f70e6baee.png)
2018-10-16 23:14:40 +08:00
Levi Matus ac8966cc8c Example to show How to get Commit Date (#927)
## What does this change do?
Adds a small example of how to get at the date a commit took place.

### Changes
#### doc/examples/Commit.rst
Adds a block of code that demonstrates how to get at a commit's date.

## Motivation
This example is in the spirit of #874.

When I began using PyGithub it was not readily apparent to me where the commit date was being abstracted to. Being unfamiliar with Git's API, it took some convincing for me to be satisfied that the `Commit.commit.author/committer.date` path would get me the commit date.

I would hope that this would save somebody a little bit of time in the future.

## How has this been tested?
I've built the docs locally and made sure the HTML is generated as expected.

## Screenshots
![2018-10-11 3](https://user-images.githubusercontent.com/16039329/46782728-add4d980-ccfd-11e8-88dd-1e48be629eb5.png)
2018-10-11 15:51:12 +08:00
Michell Stuttgart 228e5e8219 New use examples (#920)
This PR add the follow code examples

* Issue examples (get list, get specific issue, create issue)
* Milestone examples (get list, get specific milestone, create milestone)

Ref.: https://github.com/PyGithub/PyGithub/issues/874
2018-10-08 20:33:12 +08:00
Vishal Sodani 8f4f40ecbe Add examples for searching repositories (#874) (#918) 2018-10-08 11:31:25 +08:00
Vishal Sodani 19165519a9 Add examples for Repository as per #874 (#917) 2018-10-06 18:28:51 +08:00
Aaron L. Levine cc9636af3f Add Pull Request Examples (#875)
Per @sfdye request, here is an example to acquire Pull Requests.
2018-08-23 09:06:02 +08:00
Wan Liuyang 3eb695484b Set up example docs skeleton 2018-08-21 16:03:35 +08:00