pep8'd sugar3
This commit is contained in:
parent
1252d95671
commit
c736ffefcd
@ -18,6 +18,7 @@ SUBDIRS = bin src po
|
||||
|
||||
check: test
|
||||
pyflakes $(top_srcdir)
|
||||
pep8 $(top_srcdir)
|
||||
|
||||
test:
|
||||
mkdir -p $(TESTS_TMPDIR)
|
||||
|
@ -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')
|
||||
|
@ -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])
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user