From 0031249040e04706b321a3c75714a5bcd8772dee Mon Sep 17 00:00:00 2001 From: lxnay Date: Mon, 26 May 2008 01:00:02 +0000 Subject: [PATCH] Entropy/Repository Server Interface: - more work on it - general improvements on SocketHostInterface git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@1975 cd1c1023-2f26-0410-ae45-c471fc1f0318 --- libraries/dumpTools.py | 5 +- libraries/entropy.py | 207 ++++++++++++++++++++++++---------- libraries/entropyConstants.py | 3 +- 3 files changed, 153 insertions(+), 62 deletions(-) diff --git a/libraries/dumpTools.py b/libraries/dumpTools.py index 84c1b09d3..579bccae1 100644 --- a/libraries/dumpTools.py +++ b/libraries/dumpTools.py @@ -62,10 +62,11 @@ def dumpobj(name, object, completePath = False, ignoreExceptions = True): @input: object, file object @output: file object, pointer to the beginning ''' -def serialize(object, f): +def serialize(object, f, do_seek = True): pickle.dump(object,f) f.flush() - f.seek(0) + if do_seek: + f.seek(0) return f ''' diff --git a/libraries/entropy.py b/libraries/entropy.py index e54209e2d..eb0139f78 100644 --- a/libraries/entropy.py +++ b/libraries/entropy.py @@ -162,6 +162,7 @@ class EquoInterface(TextInterface): type = "warning" ) continue + self.closeAllRepositoryDatabases(mask_clear = False) def setup_default_file_perms(self, filepath): # setup file permissions @@ -367,7 +368,7 @@ class EquoInterface(TextInterface): self.clientDbconn.closeDB() self.openClientDatabase() - def closeAllRepositoryDatabases(self): + def closeAllRepositoryDatabases(self, mask_clear = True): for item in self.repoDbCache: self.repoDbCache[item].closeDB() self.repoDbCache.clear() @@ -11811,8 +11812,10 @@ class SocketHostInterface: Entropy = intf(*args, **kwds) Entropy.urlFetcher = SocketUrlFetcher Entropy.updateProgress = self.remoteUpdateProgress - if Entropy.clientDbconn != None: + try: Entropy.clientDbconn.updateProgress = self.remoteUpdateProgress + except AttributeError: + pass Entropy.progress = self.remoteUpdateProgress return Entropy @@ -12022,6 +12025,16 @@ class SocketHostInterface: 'syntax': " end", 'from': str(self), }, + 'session_config': { + 'auth': False, + 'built_in': True, + 'cb': self.docmd_session_config, + 'args': ["session","myargs"], + 'as_user': False, + 'desc': "set session configuration options", + 'syntax': " session_config