PEP8 compatibility

This commit is contained in:
yannickulrich 2016-01-18 09:38:14 +01:00
parent 9982477759
commit 420c9a783c

View file

@ -1,11 +1,11 @@
from __future__ import absolute_import from __future__ import absolute_import
from datetime import datetime, timedelta from datetime import datetime, timedelta
from calendar import monthrange
import time import time
import uuid import uuid
import pytz import pytz
import json import json
class RemindersService(object): class RemindersService(object):
def __init__(self, service_root, session, params): def __init__(self, service_root, session, params):
self.session = session self.session = session
@ -41,8 +41,6 @@ class RemindersService(object):
local_names.append(name) local_names.append(name)
return local_names return local_names
def get_system_tz(self): def get_system_tz(self):
""" """
Retrieves the system's timezone from a list of possible options. Retrieves the system's timezone from a list of possible options.
@ -50,8 +48,6 @@ class RemindersService(object):
""" """
return self.get_all_possible_timezones_of_local_machine()[0] return self.get_all_possible_timezones_of_local_machine()[0]
def refresh(self): def refresh(self):
host = self._service_root.split('//')[1].split(':')[0] host = self._service_root.split('//')[1].split(':')[0]
self.session.headers.update({'host': host}) self.session.headers.update({'host': host})
@ -83,7 +79,7 @@ class RemindersService(object):
if reminder['pGuid'] != collection['guid']: if reminder['pGuid'] != collection['guid']:
continue continue
if reminder.has_key("dueDate"): if 'dueDate' in reminder:
if reminder['dueDate']: if reminder['dueDate']:
due = datetime( due = datetime(
reminder['dueDate'][1], reminder['dueDate'][1],
@ -94,7 +90,10 @@ class RemindersService(object):
due = None due = None
else: else:
due = None due = None
desc=reminder['description'] if reminder['description'] else "" if reminder['description']:
desc = reminder['description']
else:
desc = ""
temp.append({ temp.append({
"title": reminder['title'], "title": reminder['title'],
"desc": desc, "desc": desc,
@ -105,7 +104,7 @@ class RemindersService(object):
def post(self, title, description="", collection=None): def post(self, title, description="", collection=None):
pguid = 'tasks' pguid = 'tasks'
if collection: if collection:
if self.collections.has_key(collection): if collection in self.collections:
pguid = self.collections[collection]['guid'] pguid = self.collections[collection]['guid']
host = self._service_root.split('//')[1].split(':')[0] host = self._service_root.split('//')[1].split(':')[0]
@ -145,3 +144,4 @@ class RemindersService(object):
"ClientState": {"Collections": self.collections.values()} "ClientState": {"Collections": self.collections.values()}
}), }),
params=params_reminders) params=params_reminders)
return req.ok