Use open().read() instead of slurp()

This commit is contained in:
Sunil Mohan Adapa 2014-08-30 20:56:11 +05:30
parent 7e3d8ce54b
commit 06a50c6985
2 changed files with 1 additions and 10 deletions

View File

@ -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):

View File

@ -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)