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$"
|
|
|
|
|
2010-02-20 15:37:09 -05:00
|
|
|
from bt.file import *
|
|
|
|
from bt import signal
|
2010-01-24 21:29:02 -05:00
|
|
|
|
|
|
|
|
2010-02-20 15:37:09 -05:00
|
|
|
class Alias(dict):
|
|
|
|
def __init__(self):
|
|
|
|
dict.__init__(self)
|
2010-01-24 21:29:02 -05:00
|
|
|
|
|
|
|
|
2010-02-20 15:37:09 -05:00
|
|
|
def has(self,key):
|
|
|
|
return ( key in self.keys() )
|
2010-01-24 21:29:02 -05:00
|
|
|
|
|
|
|
|
2010-02-20 15:37:09 -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
|
|
|
|
|
|
|
|
2010-02-20 15:37:09 -05:00
|
|
|
def load(self,path):
|
|
|
|
path = join(path,"aliases")
|
|
|
|
write("Alias file: "+path,1)
|
|
|
|
signal.attachScript("scion-plugins-loaded", path )
|