From 06a50c6985e80f6f930219e0519946158a4ab5bf Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sat, 30 Aug 2014 20:56:11 +0530 Subject: [PATCH] Use open().read() instead of slurp() --- plinth/modules/config/config.py | 3 +-- plinth/util.py | 8 -------- 2 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 plinth/util.py diff --git a/plinth/modules/config/config.py b/plinth/modules/config/config.py index 5c88424cd..602a977c9 100644 --- a/plinth/modules/config/config.py +++ b/plinth/modules/config/config.py @@ -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): diff --git a/plinth/util.py b/plinth/util.py deleted file mode 100644 index 592725f03..000000000 --- a/plinth/util.py +++ /dev/null @@ -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)