diff options
Diffstat (limited to 'src/Types.py')
-rw-r--r-- | src/Types.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/Types.py b/src/Types.py index e69de29bb..0e88602df 100644 --- a/src/Types.py +++ b/src/Types.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +from binascii import b2a_base64 + +class ConfigFile(object): + format="<ConfigFile name='%s' owner='%s' group='%s' perms='%s' encoding='%s'>%s</ConfigFile>" + def __init__(self,name,owner,group,perms,content,encoding='ascii'): + self.name=name + self.owner=owner + self.group=group + self.perms=perms + self.content=content + self.encoding=encoding + if encoding == 'base64': + self.xcontent=b2a_base64(content) + else: + self.xcontent=content + + def XMLSerialize(self): + return self.format%(self.name,self.owner,self.group,self.perms,self.encoding,self.xcontent) + + |