summaryrefslogtreecommitdiff
path: root/alot/__main__.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2016-12-28 11:13:15 -0800
committerDylan Baker <dylan@pnwbakers.com>2016-12-28 11:13:53 -0800
commitd7145b239a5b2e18476e03a80727947e1543ce23 (patch)
tree852534606a7c7883012ef4c4938e3eb7a37ca062 /alot/__main__.py
parent3e8ba6e1380c900945cf2d03694d127021b2c724 (diff)
Revert "Fix values to methods in __main__"
This reverts commit 581ed2987bd456d2894637a30bb5a14a4caa5f9b. Fixes #942
Diffstat (limited to 'alot/__main__.py')
-rw-r--r--alot/__main__.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/alot/__main__.py b/alot/__main__.py
index 829983c5..00b34c4e 100644
--- a/alot/__main__.py
+++ b/alot/__main__.py
@@ -60,8 +60,8 @@ class ComposeOptions(SubcommandOptions):
class SearchOptions(SubcommandOptions):
accepted = ['oldest_first', 'newest_first', 'message_id', 'unsorted']
- def colourint(self, val):
- if val not in self.accepted:
+ def colourint(val):
+ if val not in accepted:
raise ValueError("Unknown sort order")
return val
colourint.coerceDoc = "Must be one of " + str(accepted)
@@ -73,18 +73,14 @@ class SearchOptions(SubcommandOptions):
class Options(usage.Options):
optFlags = [["read-only", "r", 'open db in read only mode'], ]
- # Should be static method, except static methods are slotted and cannot
- # have arbitrary attributes attached
- def colourint(self, val):
+ def colourint(val):
val = int(val)
if val not in [1, 16, 256]:
raise ValueError("Not in range")
return val
colourint.coerceDoc = "Must be 1, 16 or 256"
- # Should be static method, except static methods are slotted and cannot
- # have arbitrary attributes attached
- def debuglogstring(self, val):
+ def debuglogstring(val):
if val not in ['error', 'debug', 'info', 'warning']:
raise ValueError("Not in range")
return val