pep8'd sugar3

This commit is contained in:
William Orr 2013-05-17 22:33:36 -04:00 committed by Daniel Narvaez
parent 1252d95671
commit c736ffefcd
8 changed files with 30 additions and 27 deletions

View File

@ -18,6 +18,7 @@ SUBDIRS = bin src po
check: test
pyflakes $(top_srcdir)
pep8 $(top_srcdir)
test:
mkdir -p $(TESTS_TMPDIR)

View File

@ -39,7 +39,7 @@ def get_profile_path(path=None):
except OSError:
print 'Could not create user directory.'
if path != None:
if path is not None:
return os.path.join(base, path)
else:
return base
@ -47,7 +47,7 @@ def get_profile_path(path=None):
def get_logs_path(path=None):
base = os.environ.get('SUGAR_LOGS_DIR', get_profile_path('logs'))
if path != None:
if path is not None:
return os.path.join(base, path)
else:
return base
@ -57,5 +57,6 @@ def get_user_activities_path():
return os.environ.get("SUGAR_ACTIVITIES_PATH",
os.path.expanduser('~/Activities'))
def get_user_library_path():
return os.path.expanduser('~/Library')

View File

@ -147,7 +147,8 @@ def start(log_filename=None):
if e.errno != errno.ENOSPC:
raise e
logging.basicConfig(level=logging.WARNING,
logging.basicConfig(
level=logging.WARNING,
format="%(created)f %(levelname)s %(name)s: %(message)s",
stream=SafeLogWrapper(sys.stderr))
@ -218,7 +219,7 @@ def trace(logger=None, logger_name=None, skip_args=None, skip_kwargs=None,
params_formatted = ", ".join(
[trace_repr.repr(a)
for (idx, a) in enumerate(args) if idx not in skip_args] + \
for (idx, a) in enumerate(args) if idx not in skip_args] +
['%s=%s' % (k, trace_repr.repr(v))
for (k, v) in kwargs.items() if k not in skip_kwargs])

View File

@ -184,14 +184,14 @@ class LRU:
def __iter__(self):
cur = self.first
while cur != None:
while cur is not None:
cur2 = cur.next
yield cur.me[1]
cur = cur2
def iteritems(self):
cur = self.first
while cur != None:
while cur is not None:
cur2 = cur.next
yield cur.me
cur = cur2