summaryrefslogtreecommitdiff
path: root/alot/db/utils.py
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2014-08-02 18:01:57 +0200
committerPatrick Totzke <patricktotzke@gmail.com>2014-08-02 18:01:57 +0200
commit30dbe55e0281210af339a13fa6c12c7aa5167313 (patch)
treeba7c99a6f58b80163bb0a14c70a8102403cfe912 /alot/db/utils.py
parent2a93e66df116af737c2c0da1b9132542a803c1fb (diff)
just formating (pep8 etc.)
Diffstat (limited to 'alot/db/utils.py')
-rw-r--r--alot/db/utils.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/alot/db/utils.py b/alot/db/utils.py
index 40b743b9..bea7b0c6 100644
--- a/alot/db/utils.py
+++ b/alot/db/utils.py
@@ -150,7 +150,8 @@ def message_from_file(handle):
want = 'application/octet-stream'
ct = m.get_payload(1).get_content_type()
if ct != want:
- malformed = u'expected Content-Type: {0}, got: {1}'.format(want, ct)
+ malformed = u'expected Content-Type: {0}, got: {1}'.format(want,
+ ct)
if not malformed:
try:
@@ -398,11 +399,12 @@ def encode_header(key, value):
value = Header(value)
return value
+
def is_subdir_of(subpath, superpath):
- #make both absolute
+ # make both absolute
superpath = os.path.realpath(superpath)
subpath = os.path.realpath(subpath)
- #return true, if the common prefix of both is equal to directory
- #e.g. /a/b/c/d.rst and directory is /a/b, the common prefix is /a/b
+ # return true, if the common prefix of both is equal to directory
+ # e.g. /a/b/c/d.rst and directory is /a/b, the common prefix is /a/b
return os.path.commonprefix([subpath, superpath]) == superpath