mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +00:00
Use open().read() instead of slurp()
This commit is contained in:
parent
7e3d8ce54b
commit
06a50c6985
@ -31,7 +31,6 @@ import socket
|
||||
|
||||
from plinth import actions
|
||||
from plinth import cfg
|
||||
from plinth import util
|
||||
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
@ -127,7 +126,7 @@ def index(request):
|
||||
def get_status():
|
||||
"""Return the current status"""
|
||||
return {'hostname': get_hostname(),
|
||||
'time_zone': util.slurp('/etc/timezone').rstrip()}
|
||||
'time_zone': open('/etc/timezone').read().rstrip()}
|
||||
|
||||
|
||||
def _apply_changes(request, old_status, new_status):
|
||||
|
||||
@ -1,8 +0,0 @@
|
||||
def slurp(filespec):
|
||||
with open(filespec) as x: f = x.read()
|
||||
return f
|
||||
|
||||
|
||||
def unslurp(filespec, msg):
|
||||
with open(filespec, 'w') as x:
|
||||
x.write(msg)
|
||||
Loading…
x
Reference in New Issue
Block a user