aif-ng/aif/system/__init__.py
brent s d7d85c7d9d future proofing is good, but...
since print() was made a function in py3, i can predict at some point
that return will be made a func as well. sure, good.
but "return()" *currently* returns an empty tuple. We want to
explicitly return None for testing purposes.
2019-12-11 04:33:15 -05:00

22 lines
753 B
Python

from . import locales
from . import console
from . import users
from . import services
class Sys(object):
def __init__(self, chroot_base, system_xml):
self.xml = system_xml
self.chroot_base = chroot_base
self.locale = locales.Locale(self.chroot_base, self.xml.find('locales'))
self.tz = locales.Timezone(self.chroot_base, self.xml.attrib.get('timezone', 'UTC'))
self.user = users.UserDB(self.chroot_base, self.xml.find('rootPassword'), self.xml.find('users'))
self.services = services.ServiceDB(self.chroot_base, self.xml.find('services'))
def apply(self):
self.locale.writeConf()
self.tz.apply()
self.user.writeConf()
self.services.apply()
return(None)