mirror of
https://github.com/erkin/ponysay.git
synced 2024-11-22 04:27:58 +01:00
use pickle
Signed-off-by: Mattias Andrée <maandree@operamail.com>
This commit is contained in:
parent
50fb5f4095
commit
4a7c7279f5
2 changed files with 4 additions and 4 deletions
|
@ -107,12 +107,12 @@ class Metadata():
|
|||
'''
|
||||
@staticmethod
|
||||
def restrictedPonies(ponydir, logic):
|
||||
import cPickle
|
||||
import pickle
|
||||
passed = []
|
||||
if os.path.exists(ponydir + 'metadata'):
|
||||
data = None
|
||||
with open(ponydir + 'metadata', 'rb') as file:
|
||||
data = cPickle.load(file)
|
||||
data = pickle.load(file)
|
||||
for ponydata in data:
|
||||
(pony, meta) = ponydata
|
||||
if logic(meta):
|
||||
|
|
|
@ -646,9 +646,9 @@ class PonysayTool():
|
|||
if (len(test) == 0) and (len(key) > 0):
|
||||
data.append((key, makeset(value.replace(' ', ''))))
|
||||
everything.append((ponyfile[:-5], data))
|
||||
import cPickle
|
||||
import pickle
|
||||
with open((ponydir + '/metadata').replace('//', '/'), 'wb') as file:
|
||||
cPickle.dump(everything, file, -1)
|
||||
pickle.dump(everything, file, -1)
|
||||
file.flush()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue