[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r6993 - in trunk/gnue-appserver/src: . gcd gld
From: |
johannes |
Subject: |
[gnue] r6993 - in trunk/gnue-appserver/src: . gcd gld |
Date: |
Fri, 11 Feb 2005 03:59:16 -0600 (CST) |
Author: johannes
Date: 2005-02-11 03:59:15 -0600 (Fri, 11 Feb 2005)
New Revision: 6993
Modified:
trunk/gnue-appserver/src/gcd/readgcd.py
trunk/gnue-appserver/src/geasGsdGen.py
trunk/gnue-appserver/src/gld/readgld.py
Log:
Use uuid-generator instead of whrandom, use 'appserver'-configuration (and it's
defaults)
Modified: trunk/gnue-appserver/src/gcd/readgcd.py
===================================================================
--- trunk/gnue-appserver/src/gcd/readgcd.py 2005-02-11 09:18:43 UTC (rev
6992)
+++ trunk/gnue-appserver/src/gcd/readgcd.py 2005-02-11 09:59:15 UTC (rev
6993)
@@ -24,16 +24,17 @@
import sys
import os
import string
-import whrandom
from gnue.common.apps import i18n, errors
from gnue.common.apps.GClientApp import *
from gnue.common.utils.FileUtils import openResource
from gnue.common.datasources import GDataSource
+from gnue.common.utils.uuid import UUID
from gnue.appserver import VERSION
from gnue.appserver.gcd import GCParser
from gnue.appserver.classrep import Namespace, helpers
+from gnue.appserver import geasConfiguration
# =============================================================================
@@ -135,11 +136,12 @@
self.addCommandOption ('password', 'p', argument="password",
help = _("Set the password for the database."))
- ConfigOptions = {}
+ ConfigOptions = geasConfiguration.ConfigOptions
- GClientApp.__init__ (self, connections, 'readgcd', ConfigOptions)
+ GClientApp.__init__ (self, connections, 'appserver', ConfigOptions)
+
# ---------------------------------------------------------------------------
# Main program
# ---------------------------------------------------------------------------
@@ -214,6 +216,7 @@
self._files = []
self._dump = dump
self._fileonly = fonly
+ self._uuidType = gConfig ('uuidtype', section = 'appserver').lower ()
# ResultSets
self.moduleRS = None
@@ -1114,11 +1117,13 @@
This function generates a new gnue_id like it is done by appserver. Once
this algorithm should be replace by a better one.
"""
- result = u''
- for i in range (0, 32):
- result = result + str (int (whrandom.random () * 10))
- return result
+ if self._uuidType == 'time':
+ return UUID.generateTimeBase ()
+ else:
+ return UUID.generateRandom ()
+
+
if __name__ == "__main__":
gcdClient ().run ()
Modified: trunk/gnue-appserver/src/geasGsdGen.py
===================================================================
--- trunk/gnue-appserver/src/geasGsdGen.py 2005-02-11 09:18:43 UTC (rev
6992)
+++ trunk/gnue-appserver/src/geasGsdGen.py 2005-02-11 09:59:15 UTC (rev
6993)
@@ -38,6 +38,7 @@
from gnue.appserver import VERSION
from gnue.appserver.geasSessionManager import geasSessionManager
+from gnue.appserver import geasConfiguration
# =============================================================================
@@ -91,7 +92,7 @@
help = _("If set all detail-classes of the requestd classes will be "
"exported too"))
- ConfigOptions = {}
+ ConfigOptions = geasConfiguration.ConfigOptions
GClientApp.__init__ (self, connections, 'appserver', ConfigOptions)
@@ -321,7 +322,6 @@
'datatype'.
"""
- print "NATIVE:", repr (native)
if datatype [:6] == "string" or datatype == "id":
checktype (native, [types.NoneType, types.UnicodeType])
Modified: trunk/gnue-appserver/src/gld/readgld.py
===================================================================
--- trunk/gnue-appserver/src/gld/readgld.py 2005-02-11 09:18:43 UTC (rev
6992)
+++ trunk/gnue-appserver/src/gld/readgld.py 2005-02-11 09:59:15 UTC (rev
6993)
@@ -24,13 +24,14 @@
import sys
import os
import string
-import whrandom
from gnue.common.apps import GClientApp, i18n, errors
from gnue.common.utils.FileUtils import openResource
from gnue.common.datasources import GDataSource, GConditions
+from gnue.common.utils.uuid import UUID
from gnue.appserver import VERSION
+from gnue.appserver import geasConfiguration
from gnue.appserver.gld import GLParser
from gnue.appserver.classrep import Namespace
@@ -108,9 +109,9 @@
self.addCommandOption ('password', 'p', argument="password",
help = _("Set the password for the database."))
- ConfigOptions = {}
+ ConfigOptions = geasConfiguration.ConfigOptions
- GClientApp.GClientApp.__init__ (self, connections, 'gnue-readgld',
+ GClientApp.GClientApp.__init__ (self, connections, 'appserver',
ConfigOptions)
@@ -187,6 +188,7 @@
self._database = database
self._filenames = files
self._files = []
+ self._uuidtype = gConfig ('uuidtype', section = 'appserver').lower ()
self.__modRS = modRS
self.__clsRS = clsRS
@@ -712,12 +714,13 @@
This function generates a new gnue_id like it is done by appserver. Once
this algorithm should be replace by a better one.
"""
- result = u''
- for i in range (0, 32):
- result = result + str (int (whrandom.random () * 10))
- return result
+ if self._uuidtype == 'time':
+ return UUID.generateTimeBased ()
+ else:
+ return UUID.generateRandom ()
+
# =============================================================================
# Main program
# =============================================================================
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r6993 - in trunk/gnue-appserver/src: . gcd gld,
johannes <=