Refactored google calendar sync

This commit is contained in:
Martin Bauer
2014-04-26 11:17:10 +02:00
committed by Martin Bauer
parent 46b4078fac
commit 1aa23d2691
11 changed files with 370 additions and 374 deletions

View File

@@ -1,6 +1,6 @@
from django.core.management.base import NoArgsCommand
from eventplanner_gcal.signals import checkGCalSubscription
from eventplanner_gcal.google_sync import checkGCalSubscription
class Command(NoArgsCommand):
help = 'Checks if the GCal notification channel is still active'

View File

@@ -1,5 +1,5 @@
from django.core.management.base import NoArgsCommand
from eventplanner_gcal.signals import deleteAllGCalEvents
from eventplanner_gcal.google_sync import deleteAllGCalEvents
class Command(NoArgsCommand):
help = 'Delete all events in the google calendar created by this app'

View File

@@ -1,6 +1,6 @@
from django.core.management.base import NoArgsCommand
from eventplanner_gcal.signals import stopAllGCalSubscriptions
from eventplanner_gcal.google_sync import stopAllGCalSubscriptions
class Command(NoArgsCommand):
help = 'Stops all GCal subscriptions'

View File

@@ -1,10 +1,10 @@
from django.core.management.base import NoArgsCommand
from eventplanner_gcal.signals import syncGCalEvents
from eventplanner_gcal.google_sync import syncFromLocalToGoogle
class Command(NoArgsCommand):
help = 'Synchronize Google Calendar with locally stored Events'
def handle_noargs(self, **options):
print ( "Running Sync")
created, deleted = syncGCalEvents()
created, deleted = syncFromLocalToGoogle()
print ( "Created %d and deleted %d events" % (created,deleted) )