projects
/
lilass.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
a6c7962
)
Detect absence of a TTY, and refuse to use the CLI backend interactively in that...
author
Ralf Jung
<post@ralfj.de>
Tue, 28 Jul 2015 19:39:19 +0000
(21:39 +0200)
committer
Ralf Jung
<post@ralfj.de>
Tue, 28 Jul 2015 19:39:19 +0000
(21:39 +0200)
Fixes #2
cli_frontend.py
patch
|
blob
|
history
lilass
patch
|
blob
|
history
diff --git
a/cli_frontend.py
b/cli_frontend.py
index 5e9d400537ff3b6d6eecff624cd0662f0ead2406..15d081c06fb427dc0d3a9bcc7051713f13e41ac2 100644
(file)
--- a/
cli_frontend.py
+++ b/
cli_frontend.py
@@
-26,6
+26,8
@@
class CLIFrontend(QuestionFrontend):
print(message, file=sys.stderr)
def userChoose (self, title, choices, returns, fallback):
+ if not sys.stdin.isatty():
+ raise Exception("Choosing the setup interactively is not possible, due to lack of a TTY")
while True:
# print question
print(title)
diff --git
a/lilass
b/lilass
index 33b05fdb8be8105b7aaf5b036f92250af3d25a07..49dbeea61d24fa251af53a6702de379c495e43a6 100755
(executable)
--- a/
lilass
+++ b/
lilass
@@
-147,4
+147,3
@@
if __name__ == "__main__":
turnOnBacklight()
except Exception as e:
frontend.error(str(e))
- raise