Please help me describe the following code:
a) The structure
b) The overall feature it might provide
c) The mechanisms used to provide the feature.
class Config(object):
validKeys = [
'CompanyName', 'ExternalName',
'Hostname', 'Domain', 'SambaDomain'
]
def __init__(self):
profileLocator = open(os.path.join(Settings.BaseDir, 'currentProfile'))
profileName = profileLocator.read().replace(' ', '').strip()
self.configFile = os.path.join(Settings.BaseDir, 'profiles',
profileName)
self.cache = {}
self.cacheAge = 0
self.maxAge = 300
def __getattr__(self, name):
if name in self.validKeys:
configAge = os.stat(self.configFile).st_mtime
now = time.time()
#Setup conditions
stillValid = self.cacheAge == configAge
tooOld = (now self.
cacheAge) > self.maxAge
if self.cache and stillValid and not tooOld:
return self.cache[name]
# Read the file (full unbuffered)
cfo = open(self.configFile, 'rt')
self.cacheAge = os.stat(self.configFile).st_mtime
data = cfo.read()
cfo.close()
d = {}
exec data in d
self.cache = d
return self.cache[name]
else:
object.__getattr__(self, name, value)
my friend gave me his computer and not the pass. i moved away. forgot to ask him. im a gamer i need...
(More)
my friend gave me his computer and not the pass. i moved away. forgot to ask him. im a gamer i need java to play that serton game ps sorry for some wrong spelling
hi i have a impulse DAMBUSTER fruit machine and dont know how to stop it paying out more than i put...
(More)
hi i have a impulse DAMBUSTER fruit machine and dont know how to stop it paying out more than i put in can you help
photoshop 7.0 installation fails with the error message: "An error occurred during the move...
(More)
photoshop 7.0 installation fails with the error message: "An error occurred during the move data process : -106" Upon install process it makes it to about 1% then gives the following error code. ComponentMoveData had the following error: media name: data Componet: App-Photoshop file group: App_PS file: PHOTOSHOP.EXE error number: -106 (refer to the online help) Then when I click ok it shows this message: An error occurred during the move data process: -106. So when I hit ok it closes it all out. I really need this software loaded and Adobe does not support this version anymore. PLEASE HELP ME