mirror of
https://github.com/b4tman/sync_ics2gcal
synced 2025-01-21 23:38:58 +00:00
Merge branch 'develop'
* develop: fix requirements.txt migrate to google-auth from oauth2client update requirements.txt + [how it works] in README
This commit is contained in:
commit
881abe22f6
@ -3,3 +3,7 @@
|
|||||||
[![Build Status](https://travis-ci.org/b4tman/sync_ics2gcal.svg?branch=master)](https://travis-ci.org/b4tman/sync_ics2gcal)
|
[![Build Status](https://travis-ci.org/b4tman/sync_ics2gcal.svg?branch=master)](https://travis-ci.org/b4tman/sync_ics2gcal)
|
||||||
|
|
||||||
Python scripts for sync .ics file with Google calendar
|
Python scripts for sync .ics file with Google calendar
|
||||||
|
|
||||||
|
## How it works
|
||||||
|
|
||||||
|
![How it works](how-it-works.png)
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
from apiclient import discovery
|
|
||||||
import httplib2
|
|
||||||
import logging
|
import logging
|
||||||
from oauth2client import service_account
|
|
||||||
from pytz import utc
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
import google.auth
|
||||||
|
from google.oauth2 import service_account
|
||||||
|
from googleapiclient import discovery
|
||||||
|
from pytz import utc
|
||||||
|
|
||||||
|
|
||||||
class GoogleCalendarService():
|
class GoogleCalendarService():
|
||||||
"""class for make google calendar service Resource
|
"""class for make google calendar service Resource
|
||||||
@ -21,14 +22,12 @@ class GoogleCalendarService():
|
|||||||
service Resource
|
service Resource
|
||||||
"""
|
"""
|
||||||
|
|
||||||
scopes = 'https://www.googleapis.com/auth/calendar'
|
scopes = ['https://www.googleapis.com/auth/calendar']
|
||||||
credentials = service_account.ServiceAccountCredentials.from_json_keyfile_name(
|
credentials = service_account.Credentials.from_service_account_file(service_account_file)
|
||||||
service_account_file, scopes=scopes)
|
scoped_credentials = credentials.with_scopes(scopes)
|
||||||
http = credentials.authorize(httplib2.Http())
|
service = discovery.build('calendar', 'v3', credentials=scoped_credentials)
|
||||||
service = discovery.build('calendar', 'v3', http=http)
|
|
||||||
return service
|
return service
|
||||||
|
|
||||||
|
|
||||||
def select_event_key(event):
|
def select_event_key(event):
|
||||||
"""select event key for logging
|
"""select event key for logging
|
||||||
|
|
||||||
|
BIN
how-it-works.png
Normal file
BIN
how-it-works.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 98 KiB |
@ -1,4 +1,5 @@
|
|||||||
google-api-python-client==1.6.6
|
google-auth==1.5.0
|
||||||
icalendar==4.0.1
|
google-api-python-client==1.7.3
|
||||||
pytz==2018.3
|
icalendar==4.0.2
|
||||||
PyYAML==3.12
|
pytz==2018.5
|
||||||
|
PyYAML==3.13
|
||||||
|
Loading…
x
Reference in New Issue
Block a user