Treat entire input as password

Instead of just the first line.

PEP8 fixes.
This commit is contained in:
Sunil Mohan Adapa 2015-08-23 16:23:30 +05:30
parent 21b9a5b02a
commit 0b1e97d99c
4 changed files with 6 additions and 6 deletions

View File

@ -95,7 +95,7 @@ def subcommand_get_sites(_):
def subcommand_create_wiki(arguments):
"""Create a wiki."""
pw_bytes = sys.stdin.readline().encode()
pw_bytes = sys.stdin.read().encode()
proc = subprocess.Popen(
['ikiwiki', '-setup', SETUP_WIKI,
arguments.wiki_name, arguments.admin_name],
@ -107,7 +107,7 @@ def subcommand_create_wiki(arguments):
def subcommand_create_blog(arguments):
"""Create a blog."""
pw_bytes = sys.stdin.readline().encode()
pw_bytes = sys.stdin.read().encode()
proc = subprocess.Popen(
['ikiwiki', '-setup', SETUP_BLOG,
arguments.blog_name, arguments.admin_name],

View File

@ -224,7 +224,7 @@ def subcommand_get_kite(_):
def subcommand_set_kite(arguments):
"""Set details of the kite"""
aug.set(PATHS['kitename'], arguments.kite_name)
aug.set(PATHS['kitesecret'], sys.stdin.readline())
aug.set(PATHS['kitesecret'], sys.stdin.read())
aug.save()

View File

@ -66,7 +66,7 @@ def subcommand_disable(_):
def subcommand_merge_configuration(arguments):
"""Merge given JSON configuration with existing configuration."""
configuration = ''.join(sys.stdin.readlines())
configuration = sys.stdin.read()
configuration = json.loads(configuration)
current_configuration = open(TRANSMISSION_CONFIG, 'r').read()

View File

@ -366,7 +366,7 @@ def _apply_changes(request, old_status, new_status):
'-U', new_status['dynamicdns_update_url'],
'-c', disable_ssl_check,
'-b', use_http_basic_auth],
input = new_status['dynamicdns_secret'].encode())
input=new_status['dynamicdns_secret'].encode())
if old_status['enabled']:
_run(['stop'])