ocarina/src/core/bt/alias.py

33 lines
625 B
Python
Raw Normal View History

2010-01-24 21:29:02 -05:00
#! /usr/bin/python
# To change this template, choose Tools | Templates
# and open the template in the editor.
__author__="bjschuma"
__date__ ="$Jan 23, 2010 2:33:21 PM$"
from bt.file import *
from bt import signal
2010-01-24 21:29:02 -05:00
class Alias(dict):
def __init__(self):
dict.__init__(self)
2010-01-24 21:29:02 -05:00
def has(self,key):
return ( key in self.keys() )
2010-01-24 21:29:02 -05:00
def save(self,path):
file = fopen( join(path,"aliases"), 'w' )
sp = " "
for key in self.keys():
file.write("alias "+key+"="+self[key]+"\n")
2010-01-24 21:29:02 -05:00
def load(self,path):
path = join(path,"aliases")
write("Alias file: "+path,1)
signal.attachScript("scion-plugins-loaded", path )