Skip to content

Commit

Permalink
get rid of pickle
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Schleizer committed Jan 26, 2018
1 parent 494897d commit d79f1c7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions usr/bin/sdwdate
Expand Up @@ -14,7 +14,6 @@ import random
from random import randint
from subprocess import Popen, call, PIPE, check_output
import subprocess
import pickle
import re
from shutil import rmtree

Expand Down Expand Up @@ -90,9 +89,9 @@ class Sdwdate:
self.status_path = '/var/run/sdwdate/status'
self.msg_path = '/var/run/sdwdate/msg'

self.success_icon = '/usr/share/icons/sdwdate-gui/Ambox_currentevent.svg.png'
self.busy_icon = '/usr/share/icons/sdwdate-gui/620px-Ambox_outdated.svg.png'
self.error_icon = '/usr/share/icons/sdwdate-gui/212px-Timeblock.svg.png'
self.success_icon = 'success'
self.busy_icon = 'busy'
self.error_icon = 'error'

self.first_success = os.path.exists(self.first_success_path)
self.success = os.path.exists(self.success_path)
Expand Down Expand Up @@ -471,8 +470,9 @@ def write_status(*args):
sdwdate.status['icon'] = args[0]
sdwdate.status['message'] = args[1]
msg = bytes(args[1], encoding = 'utf-8')
icon = bytes(args[0], encoding = 'utf-8')
with open(sdwdate.status_path, 'wb') as f:
pickle.dump(sdwdate.status, f)
f.write(icon)
f.close()

with open(sdwdate.msg_path, 'wb') as msgf:
Expand Down

0 comments on commit d79f1c7

Please sign in to comment.