libsaria: Remove old file management code

I have new code for loading / saving objects, so I can remove the old
stuff.
This commit is contained in:
Bryan Schumaker 2011-04-29 08:30:55 -04:00
parent 5199a26006
commit 063869c7ca
1 changed files with 0 additions and 26 deletions

View File

@ -2,7 +2,6 @@
import libsaria
from libsaria import path
import cPickle as pickle
plugin = None
export = None
@ -10,31 +9,6 @@ dev = ""
if libsaria.__dev__ == True:
dev = "-dev"
PROTO = pickle.HIGHEST_PROTOCOL
def save(item, file, ext=".pickle"):
file = "%s%s%s" % (path.join(path.saria_dir(),file), dev, ext)
savefile(item, file)
def savefile(item, file):
f = open(file, 'w')
p = pickle.Pickler(f, PROTO)
p.dump(item)
f.close()
def load(file, ext=".pickle"):
file = "%s%s%s" % (path.join(path.saria_dir(),file), dev, ext)
return loadfile(file)
def loadfile(file):
if path.exists(file) == False:
return
f = open(file)
data = f.read()
item = pickle.loads(data)
f.close()
return item
def open_plugin(file):
global plugin
if plugin == None: