Skip to content

Commit

Permalink
Move back to bz2
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamgilbert committed Aug 18, 2015
1 parent 90ab6a3 commit e7c687f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions server/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from xml.parsers.expat import ExpatError
import base64
import bz2
import zlib
from datetime import datetime


Expand Down Expand Up @@ -97,7 +96,7 @@ class Machine(models.Model):

def encode(self, plist):
string = plistlib.writePlistToString(plist)
bz2data = zlib.compress(string)
bz2data = bz2.compress(string)
b64data = base64.b64encode(bz2data)
return b64data

Expand All @@ -120,7 +119,7 @@ def decode(self, data):
def b64bz_decode(self, data):
try:
bz2data = base64.b64decode(data)
string = zlib.decompress(bz2data)
string = bz2.decompress(bz2data)
plist = plistlib.readPlistFromString(string)
return plist
except Exception:
Expand Down

0 comments on commit e7c687f

Please sign in to comment.