From 6b4cb8ec77ffdab9d2573360bf03f0883e9aa653 Mon Sep 17 00:00:00 2001 From: maurx Date: Sun, 15 Oct 2017 12:28:33 -0200 Subject: [PATCH] Update for python 3.6 --- README.md | 8 +++++--- config.py | 3 +++ main.py | 6 +++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1b21dfd..b71802a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,9 @@ Check your progress on [Hacktoberfest](https://hacktoberfest.digitalocean.com/) ![@leereilly's Hacktoberfest contributions as of 1475644816](https://cloud.githubusercontent.com/assets/121322/19101908/aebbdb62-8a80-11e6-8321-72fcc1dd5eb6.png) ## Installation +* Requires Python 3.6 * Clone this repo `git clone https://github.com/Thor77/HacktoberfestProgress` -* Install dependencies `pip3 install -r requirements.txt` -* Modify `config.py` to suit your needs (you **have to** set `GITHUB_CLIENT_ID` and `GITHUB_CLIENT_SECRET`) -* Run the application `python3 main.py` +* Install dependencies `pip install -r requirements.txt` +* Modify `config.py` to suit your needs (you **have to** set `GITHUB_CLIENT_ID` and `GITHUB_CLIENT_SECRET`) [Get yours here](https://github.com/settings/developers "Github developers page") + +* Run the application `python3.6 main.py` diff --git a/config.py b/config.py index 5e85312..cad8db8 100644 --- a/config.py +++ b/config.py @@ -2,3 +2,6 @@ SECRET_KEY = 'N{5K$:6}6>!Y$BxKYBl9gA"*W5&(0X;Xo[Gh)%?Ci@l!EHL]$j4%:Bs' SESSION_TYPE = 'filesystem' + +GITHUB_CLIENT_ID = 'your_client_id' +GITHUB_CLIENT_SECRET = 'your_client_secret' diff --git a/main.py b/main.py index 90f8133..b5e8f70 100644 --- a/main.py +++ b/main.py @@ -14,8 +14,8 @@ api_base = 'https://api.github.com' -auth_url = 'https://github.com/login/oauth/authorize'\ - '?client_id={}'.format(client_id) +auth_url = f'https://github.com/login/oauth/authorize'\ + '?client_id={client_id}' time_range = '2017-10-01T00:00:01Z..2017-10-31T23:59:59' search_query = 'type:pr+created:' + time_range + '+author:{}' @@ -36,7 +36,7 @@ def headers(token): Build authentication-headers with `token` ''' return { - 'Authorization': 'token {}'.format(token), + 'Authorization': f'token {token}', 'User-Agent': 'HacktoberfestProgress/Thor77' }