mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
Treat entire input as password
Instead of just the first line. PEP8 fixes.
This commit is contained in:
parent
21b9a5b02a
commit
0b1e97d99c
@ -95,7 +95,7 @@ def subcommand_get_sites(_):
|
|||||||
|
|
||||||
def subcommand_create_wiki(arguments):
|
def subcommand_create_wiki(arguments):
|
||||||
"""Create a wiki."""
|
"""Create a wiki."""
|
||||||
pw_bytes = sys.stdin.readline().encode()
|
pw_bytes = sys.stdin.read().encode()
|
||||||
proc = subprocess.Popen(
|
proc = subprocess.Popen(
|
||||||
['ikiwiki', '-setup', SETUP_WIKI,
|
['ikiwiki', '-setup', SETUP_WIKI,
|
||||||
arguments.wiki_name, arguments.admin_name],
|
arguments.wiki_name, arguments.admin_name],
|
||||||
@ -107,7 +107,7 @@ def subcommand_create_wiki(arguments):
|
|||||||
|
|
||||||
def subcommand_create_blog(arguments):
|
def subcommand_create_blog(arguments):
|
||||||
"""Create a blog."""
|
"""Create a blog."""
|
||||||
pw_bytes = sys.stdin.readline().encode()
|
pw_bytes = sys.stdin.read().encode()
|
||||||
proc = subprocess.Popen(
|
proc = subprocess.Popen(
|
||||||
['ikiwiki', '-setup', SETUP_BLOG,
|
['ikiwiki', '-setup', SETUP_BLOG,
|
||||||
arguments.blog_name, arguments.admin_name],
|
arguments.blog_name, arguments.admin_name],
|
||||||
|
|||||||
@ -224,7 +224,7 @@ def subcommand_get_kite(_):
|
|||||||
def subcommand_set_kite(arguments):
|
def subcommand_set_kite(arguments):
|
||||||
"""Set details of the kite"""
|
"""Set details of the kite"""
|
||||||
aug.set(PATHS['kitename'], arguments.kite_name)
|
aug.set(PATHS['kitename'], arguments.kite_name)
|
||||||
aug.set(PATHS['kitesecret'], sys.stdin.readline())
|
aug.set(PATHS['kitesecret'], sys.stdin.read())
|
||||||
aug.save()
|
aug.save()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,7 @@ def parse_arguments():
|
|||||||
|
|
||||||
# Merge given JSON configration with existing
|
# Merge given JSON configration with existing
|
||||||
subparsers.add_parser(
|
subparsers.add_parser(
|
||||||
'merge-configuration',
|
'merge-configuration',
|
||||||
help='Merge JSON configuration from stdin with existing')
|
help='Merge JSON configuration from stdin with existing')
|
||||||
|
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
@ -66,7 +66,7 @@ def subcommand_disable(_):
|
|||||||
|
|
||||||
def subcommand_merge_configuration(arguments):
|
def subcommand_merge_configuration(arguments):
|
||||||
"""Merge given JSON configuration with existing configuration."""
|
"""Merge given JSON configuration with existing configuration."""
|
||||||
configuration = ''.join(sys.stdin.readlines())
|
configuration = sys.stdin.read()
|
||||||
configuration = json.loads(configuration)
|
configuration = json.loads(configuration)
|
||||||
|
|
||||||
current_configuration = open(TRANSMISSION_CONFIG, 'r').read()
|
current_configuration = open(TRANSMISSION_CONFIG, 'r').read()
|
||||||
|
|||||||
@ -366,7 +366,7 @@ def _apply_changes(request, old_status, new_status):
|
|||||||
'-U', new_status['dynamicdns_update_url'],
|
'-U', new_status['dynamicdns_update_url'],
|
||||||
'-c', disable_ssl_check,
|
'-c', disable_ssl_check,
|
||||||
'-b', use_http_basic_auth],
|
'-b', use_http_basic_auth],
|
||||||
input = new_status['dynamicdns_secret'].encode())
|
input=new_status['dynamicdns_secret'].encode())
|
||||||
|
|
||||||
if old_status['enabled']:
|
if old_status['enabled']:
|
||||||
_run(['stop'])
|
_run(['stop'])
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user