Author: reinhard
Date: 2010-12-02 17:29:23 -0600 (Thu, 02 Dec 2010)
New Revision: 10259

Modified:
   trunk/gnue-common/
   trunk/gnue-common/src/apps/GDebug.py
   trunk/gnue-common/src/apps/i18n.py
   trunk/gnue-common/src/datasources/ConnectionTriggerObj.py
   trunk/gnue-common/src/datasources/GConnections.py
   trunk/gnue-common/src/datasources/GDataSource.py
   trunk/gnue-common/src/datasources/GLoginHandler.py
   trunk/gnue-common/src/logic/NamespaceCore.py
   trunk/gnue-common/src/logic/adapters/Base.py
   trunk/gnue-common/src/logic/adapters/python.py
   trunk/gnue-common/src/logic/language.py
Log:
Cleanup of deprecated stuff.



Property changes on: trunk/gnue-common
___________________________________________________________________
Name: bzr:revision-info
   - timestamp: 2010-12-02 23:22:36.885999918 +0100
committer: Reinhard Müller <reinhard.muel...@bytewise.at>
properties: 
        branch-nick: common

   + timestamp: 2010-12-03 00:28:11.546999931 +0100
committer: Reinhard Müller <reinhard.muel...@bytewise.at>
properties: 
        branch-nick: common

Name: bzr:file-ids
   - src/definitions/GParser.py 
9...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Fdefinitions%2FGParser.py

   + src/apps/GDebug.py 
1...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Fapps%2FGDebug.py
src/apps/i18n.py        
5...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Fapps%2Fi18n.py
src/datasources/ConnectionTriggerObj.py 
5...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Fdatasources%2FConnectionTriggerObj.py
src/datasources/GConnections.py 
1...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Fdatasources%2FGConnections.py
src/datasources/GDataSource.py  
1...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Fdatasources%2FGDataSource.py
src/datasources/GLoginHandler.py        
1...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Fdatasources%2FGLoginHandler.py
src/logic/NamespaceCore.py      
3...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Flogic%2FNamespaceCore.py
src/logic/adapters/Base.py      
5...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Flogic%2Fadapters%2FBase.py
src/logic/adapters/python.py    
5...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Flogic%2Fadapters%2Fpython.py
src/logic/language.py   
5...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Flogic%2Flanguage.py

Name: bzr:revision-id:v4
   - 3116 reinhard.muel...@bytewise.at-20100426083315-ccfwx2pihuvqn60z
3117 reinhard.muel...@bytewise.at-20100503114756-unpxm52de0towufo
3118 reinhard.muel...@bytewise.at-20100503115129-uvondrz5bvkqubyv
3119 reinhard.muel...@bytewise.at-20100505081835-9peco6k7a2le0mvg
3120 reinhard.muel...@bytewise.at-20100505084742-wn5vtc4a129z8g28
3121 reinhard.muel...@bytewise.at-20100505092131-m2avvsci5w6aj0rv
3122 reinhard.muel...@bytewise.at-20100519151545-pybk8q2s234vzsf2
3123 reinhard.muel...@bytewise.at-20100525101023-xs7k6pkghh9t6fc3
3124 reinhard.muel...@bytewise.at-20100525114015-rj7eb0xdheqkcuql
3125 reinhard.muel...@bytewise.at-20100525145035-j177jbvu10me4mfp
3126 reinhard.muel...@bytewise.at-20100526111738-ic0wot9z1ulg2y1a
3127 reinhard.muel...@bytewise.at-20100612121357-1nf23tuj1tveh1lv
3128 reinhard.muel...@bytewise.at-20100929190642-6pp6cwlicgt2bhhs
3129 reinhard.muel...@bytewise.at-20100929190817-bje4kkvrjrpanut1
3130 reinhard.muel...@bytewise.at-20101016191602-kceb6hdjytt4im93
3131 reinhard.muel...@bytewise.at-20101020175112-o65lqy8lejjrvzaz
3132 reinhard.muel...@bytewise.at-20101020195535-gb2bt2h80mu5j5h4
3133 reinhard.muel...@bytewise.at-20101020203525-nvdwy7b9r84bngco
3134 reinhard.muel...@bytewise.at-20101028150844-49qu2auedxl5b5kv
3135 reinhard.muel...@bytewise.at-20101028152619-p6ytgkke9zw38o7a
3136 reinhard.muel...@bytewise.at-20101102085744-sfxbu24ep3nwxixc
3137 reinhard.muel...@bytewise.at-20101102085857-sgtswbhhj0baf9d7
3138 reinhard.muel...@bytewise.at-20101103071215-929sbj5boj2wcxuu
3139 reinhard.muel...@bytewise.at-20101114130053-ueyx4ilszsilw6hc
3140 reinhard.muel...@bytewise.at-20101114183532-h66yegryl7hcen0f
3141 reinhard.muel...@bytewise.at-20101130142356-cxfqmitx4trkjcja
3142 reinhard.muel...@bytewise.at-20101201235201-z7jjs7xhfmonjcni
3143 reinhard.muel...@bytewise.at-20101202213225-9hj88a0rur552boy
3144 reinhard.muel...@bytewise.at-20101202222236-g81i5zcnxr8l2q7o

   + 3116 reinhard.muel...@bytewise.at-20100426083315-ccfwx2pihuvqn60z
3117 reinhard.muel...@bytewise.at-20100503114756-unpxm52de0towufo
3118 reinhard.muel...@bytewise.at-20100503115129-uvondrz5bvkqubyv
3119 reinhard.muel...@bytewise.at-20100505081835-9peco6k7a2le0mvg
3120 reinhard.muel...@bytewise.at-20100505084742-wn5vtc4a129z8g28
3121 reinhard.muel...@bytewise.at-20100505092131-m2avvsci5w6aj0rv
3122 reinhard.muel...@bytewise.at-20100519151545-pybk8q2s234vzsf2
3123 reinhard.muel...@bytewise.at-20100525101023-xs7k6pkghh9t6fc3
3124 reinhard.muel...@bytewise.at-20100525114015-rj7eb0xdheqkcuql
3125 reinhard.muel...@bytewise.at-20100525145035-j177jbvu10me4mfp
3126 reinhard.muel...@bytewise.at-20100526111738-ic0wot9z1ulg2y1a
3127 reinhard.muel...@bytewise.at-20100612121357-1nf23tuj1tveh1lv
3128 reinhard.muel...@bytewise.at-20100929190642-6pp6cwlicgt2bhhs
3129 reinhard.muel...@bytewise.at-20100929190817-bje4kkvrjrpanut1
3130 reinhard.muel...@bytewise.at-20101016191602-kceb6hdjytt4im93
3131 reinhard.muel...@bytewise.at-20101020175112-o65lqy8lejjrvzaz
3132 reinhard.muel...@bytewise.at-20101020195535-gb2bt2h80mu5j5h4
3133 reinhard.muel...@bytewise.at-20101020203525-nvdwy7b9r84bngco
3134 reinhard.muel...@bytewise.at-20101028150844-49qu2auedxl5b5kv
3135 reinhard.muel...@bytewise.at-20101028152619-p6ytgkke9zw38o7a
3136 reinhard.muel...@bytewise.at-20101102085744-sfxbu24ep3nwxixc
3137 reinhard.muel...@bytewise.at-20101102085857-sgtswbhhj0baf9d7
3138 reinhard.muel...@bytewise.at-20101103071215-929sbj5boj2wcxuu
3139 reinhard.muel...@bytewise.at-20101114130053-ueyx4ilszsilw6hc
3140 reinhard.muel...@bytewise.at-20101114183532-h66yegryl7hcen0f
3141 reinhard.muel...@bytewise.at-20101130142356-cxfqmitx4trkjcja
3142 reinhard.muel...@bytewise.at-20101201235201-z7jjs7xhfmonjcni
3143 reinhard.muel...@bytewise.at-20101202213225-9hj88a0rur552boy
3144 reinhard.muel...@bytewise.at-20101202222236-g81i5zcnxr8l2q7o
3145 reinhard.muel...@bytewise.at-20101202232811-ydwqz1rwr8a17fad

Name: bzr:text-parents
   - src/definitions/GParser.py 
svn-v3-single1-dHJ1bmsvZ251ZS1jb21tb24.:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:10063

   + src/apps/GDebug.py 
svn-v3-single1-dHJ1bmsvZ251ZS1jb21tb24.:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:9954
src/apps/i18n.py        
svn-v3-single1-dHJ1bmsvZ251ZS1jb21tb24.:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:9954
src/datasources/ConnectionTriggerObj.py 
svn-v3-single1-dHJ1bmsvZ251ZS1jb21tb24.:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:9986
src/datasources/GConnections.py 
reinhard.muel...@bytewise.at-20100929190642-6pp6cwlicgt2bhhs
src/datasources/GDataSource.py  
reinhard.muel...@bytewise.at-20100525101023-xs7k6pkghh9t6fc3
src/datasources/GLoginHandler.py        
svn-v3-single1-dHJ1bmsvZ251ZS1jb21tb24.:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:9954
src/logic/NamespaceCore.py      
svn-v3-single1-dHJ1bmsvZ251ZS1jb21tb24.:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:9954
src/logic/adapters/Base.py      
svn-v3-single1-dHJ1bmsvZ251ZS1jb21tb24.:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:9954
src/logic/adapters/python.py    
svn-v3-single1-dHJ1bmsvZ251ZS1jb21tb24.:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:9954
src/logic/language.py   
svn-v3-single1-dHJ1bmsvZ251ZS1jb21tb24.:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:9954


Modified: trunk/gnue-common/src/apps/GDebug.py
===================================================================
--- trunk/gnue-common/src/apps/GDebug.py        2010-12-02 22:27:05 UTC (rev 
10258)
+++ trunk/gnue-common/src/apps/GDebug.py        2010-12-02 23:29:23 UTC (rev 
10259)
@@ -28,6 +28,8 @@
 messages to a file.
 """
 
+# TODO: Deprecate everything with 0.8, remove with 0.9
+
 import __builtin__
 import inspect
 import os
@@ -211,7 +213,7 @@
     @param file: Filename to output debug messages to (instead of stderr)
     """
 
-    global _DEBUG_LEVELS, printMesg
+    global _DEBUG_LEVELS
 
     # Find out debug levels
     levels = []
@@ -244,15 +246,3 @@
             hnd.setFormatter(fmt)
             lgr.addHandler(hnd)
             lgr.setLevel(logging.DEBUG)
-
-
-# -----------------------------------------------------------------------------
-# Deprecated, for compatibility
-# -----------------------------------------------------------------------------
-
-def printMesg (level, message):
-    """
-    DEPRECATED. Use the logging functions in L{gnue.common.base.log}
-    instead.
-    """
-    __builtin__.__dict__ ['gDebug'] (level, message)

Modified: trunk/gnue-common/src/apps/i18n.py
===================================================================
--- trunk/gnue-common/src/apps/i18n.py  2010-12-02 22:27:05 UTC (rev 10258)
+++ trunk/gnue-common/src/apps/i18n.py  2010-12-02 23:29:23 UTC (rev 10259)
@@ -30,6 +30,8 @@
 @var encoding: Encoding of the current locale
 """
 
+# TODO: Deprecate with 0.8, remove with 0.9
+
 import locale
 import os
 import sys

Modified: trunk/gnue-common/src/datasources/ConnectionTriggerObj.py
===================================================================
--- trunk/gnue-common/src/datasources/ConnectionTriggerObj.py   2010-12-02 
22:27:05 UTC (rev 10258)
+++ trunk/gnue-common/src/datasources/ConnectionTriggerObj.py   2010-12-02 
23:29:23 UTC (rev 10259)
@@ -98,19 +98,3 @@
             assert log.debug ("Cannot add connection %s to object tree" % name)
             continue
         root_object.addChild(ConnectionTriggerObj(conn, name))
-
-
-# Depreciated
-
-def addAllConnections (connections, gobjNamespace): 
-  """
-  Adds all the connection names to the global trigger namespace. DEPRECIATED.
-  """
-
-  for name in connections.backends.BACKENDS.sections(): 
-    try: 
-      conn = connections.getConnection (name)
-    except: 
-      assert log.debug ("Cannot add connection %s to trigger namespace" % name)
-      continue
-    gobjNamespace.constructTriggerObject (ConnectionTriggerObj (conn, name))

Modified: trunk/gnue-common/src/datasources/GConnections.py
===================================================================
--- trunk/gnue-common/src/datasources/GConnections.py   2010-12-02 22:27:05 UTC 
(rev 10258)
+++ trunk/gnue-common/src/datasources/GConnections.py   2010-12-02 23:29:23 UTC 
(rev 10259)
@@ -130,7 +130,7 @@
 
     return backends.BACKENDS.sections()
 
-  getConnectionNames = log.deprecated_f(getConnectionNames)
+  getConnectionNames = log.deprecated_f(getConnectionNames) # Remove with 0.8.
 
 
   # ---------------------------------------------------------------------------
@@ -146,7 +146,7 @@
     for section in backends.BACKENDS.sections():
         result[section] = dict(backends.BACKENDS.items(section))
 
-  getAllConnectionParameters = log.deprecated_f(getAllConnectionParameters)
+  getAllConnectionParameters = log.deprecated_f(getAllConnectionParameters) # 
Remove with 0.8
 
 
   # ---------------------------------------------------------------------------
@@ -163,7 +163,7 @@
 
     return dict(backends.BACKENDS.items(connection_name))
 
-  getConnectionParameters = log.deprecated_f(getConnectionParameters)
+  getConnectionParameters = log.deprecated_f(getConnectionParameters) # Remove 
with 0.8
 
 
   # ---------------------------------------------------------------------------

Modified: trunk/gnue-common/src/datasources/GDataSource.py
===================================================================
--- trunk/gnue-common/src/datasources/GDataSource.py    2010-12-02 22:27:05 UTC 
(rev 10258)
+++ trunk/gnue-common/src/datasources/GDataSource.py    2010-12-02 23:29:23 UTC 
(rev 10259)
@@ -239,6 +239,9 @@
   # ---------------------------------------------------------------------------
 
   def __trigger_set_order_by (self, value):
+    if isinstance(value, basestring):
+        log.deprecated("setting the sortorder as a string is deprecated. "
+                "Use a list of dictionaries instead.")  # Remove with 0.8
     self.__sortorder = self.__convertOrderBy (value)
 
 
@@ -847,8 +850,6 @@
     # If it's a string or a unicode string, we transform it into a tuple
     # sequence, where all items are treated to be in 'ascending' order
     if isinstance (order_by, basestring):
-      assert log.debug ("DEPRECIATION WARNING: use of 'order_by' attribute is 
" \
-                 "depreciated. Please use <sortorder> instead.")
       for field in order_by.split (','):
         (item, desc) = (field, field [-5:].lower () == ' desc')
         if desc:

Modified: trunk/gnue-common/src/datasources/GLoginHandler.py
===================================================================
--- trunk/gnue-common/src/datasources/GLoginHandler.py  2010-12-02 22:27:05 UTC 
(rev 10258)
+++ trunk/gnue-common/src/datasources/GLoginHandler.py  2010-12-02 23:29:23 UTC 
(rev 10259)
@@ -59,34 +59,6 @@
   """
 
   # ---------------------------------------------------------------------------
-  # Get login information (depreciated)
-  # ---------------------------------------------------------------------------
-
-  def getLogin (self, requiredFields, errortext = None):
-    """
-    DEPRECIATED: get information for the given fields and return a dictionary 
-
-    @param requiredFields: sequence of [connection name, description, sequence
-        of fields (name, label, is password)]
-    @param errortext: message of the last error occured
-
-    @raises UserCanceledLogin: if the user canceled the login request
-    """
-    pass
-
-
-  # ---------------------------------------------------------------------------
-  # Called when the app no longer needs the login handler
-  # ---------------------------------------------------------------------------
-
-  def destroyLoginDialog (self):
-    """
-    DEPRECIATED
-    """
-    pass
-
-
-  # ---------------------------------------------------------------------------
   # Ask for all fields given by the field definitions
   # ---------------------------------------------------------------------------
 
@@ -139,40 +111,10 @@
   def _askLogin_ (self, title, fields):
     """
     Descendants override this method to do all the dirty work for askLogin ().
-
-    This class converts the given field definition sequence into an old style
-    format as required by getLogin () and finally calls getLogin. This process
-    will fade out as soon as getLogin is obsolete.
     """
+    pass
 
-    # flatten the blown-up sequence till all support the new style definitions
-    data   = []
-    labels = []
-    error  = None
 
-    for (label, name, ftype, default, master, elements) in fields:
-      if ftype in ['image']:
-        continue
-
-      elif ftype == 'label':
-        labels.append (label)
-
-      elif ftype == 'warning':
-        error = label
-
-      else:
-        data.append ((name, label, ftype == 'password'))
-
-    try:
-      name = len (labels) and labels [0] or ''
-      desc = len (labels) > 1 and labels [1] or ''
-      result = self.getLogin ([name, desc, data], error)
-    finally:
-      self.destroyLoginDialog ()
-
-    return result
-
-
 # =============================================================================
 # Class implementing a basic login handler using raw_input and getpass
 # =============================================================================

Modified: trunk/gnue-common/src/logic/NamespaceCore.py
===================================================================
--- trunk/gnue-common/src/logic/NamespaceCore.py        2010-12-02 22:27:05 UTC 
(rev 10258)
+++ trunk/gnue-common/src/logic/NamespaceCore.py        2010-12-02 23:29:23 UTC 
(rev 10259)
@@ -61,20 +61,5 @@
         self._globalNamespace = {}
 
         self._globalNamespace[rootName] = \
-                self.constructTriggerObject(xml_object)
-
-
-    # -------------------------------------------------------------------------
-    # Construct a namespace object tree for an XML object tree
-    # -------------------------------------------------------------------------
-
-    def constructTriggerObject(self, xml_object):
-        """
-        Construct a namespace object tree from an XML
-        (L{definitions.GObjects.GObj}) object tree. DEPRECIATED.
-
-        Depreciated. Use xml_object.create_namespace_object instead.
-        """
-
-        return xml_object.create_namespace_object(self._globalNamespace,
-                self.__root_name)
+                xml_object.create_namespace_object(self._globalNamespace,
+                        self.__root_name)

Modified: trunk/gnue-common/src/logic/adapters/Base.py
===================================================================
--- trunk/gnue-common/src/logic/adapters/Base.py        2010-12-02 22:27:05 UTC 
(rev 10258)
+++ trunk/gnue-common/src/logic/adapters/Base.py        2010-12-02 23:29:23 UTC 
(rev 10259)
@@ -40,6 +40,7 @@
 import re
 import types
 
+from gnue.common.base import log
 from gnue.common.logic.language import ImplementationError, AbortRequest
 
 __all__ = ['LanguageAdapter', 'ExecutionContext']
@@ -51,7 +52,7 @@
 
 class LanguageAdapter:
     """
-    Base class for language adapters. DEPRECIATED.
+    Base class for language adapters. DEPRECATED.
 
     This class will be depreciated in 0.7 and removed in 0.8.
     Depreciated. Use L{language.create_execution_context} instead.
@@ -64,7 +65,7 @@
     def createNewContext(self):
         """
         Create a new execution context in which user provided code can run.
-        DEPRECIATED.
+        DEPRECATED.
 
         This function will be depreciated in 0.7 and removed in 0.8.
         Use L{language.create_execution_context} instead.
@@ -200,9 +201,10 @@
     # Depreciated methods
     # -------------------------------------------------------------------------
 
+    @log.deprecated_f                       # Remove with 0.8
     def defineNamespace(self, addNS, asGlobal = False):
         """
-        Define the namespace for this execution context. DEPRECIATED.
+        Define the namespace for this execution context. DEPRECATED.
 
         This function will be depreciated in 0.7 and removed in 0.8.
         Use L{language.create_execution_context} instead to define all
@@ -223,7 +225,7 @@
 
     def bindObject(self, name, aObject, asGlobal = False):
         """
-        Bind an object into the namespace. DEPRECIATED.
+        Bind an object into the namespace. DEPRECATED.
 
         This function will be depreciated in 0.7 and removed in 0.8.
         Use L{language.create_execution_context} instead to define all
@@ -238,7 +240,7 @@
 
     def bindFunction(self, name, aFunction, asGlobal = False):
         """
-        Bind a function into the namespace. DEPRECIATED.
+        Bind a function into the namespace. DEPRECATED.
 
         This function will be depreciated in 0.7 and removed in 0.8.
         Use L{language.create_execution_context} instead to define all
@@ -253,7 +255,7 @@
 
     def bindBuiltin(self, name, anElement):
         """
-        Bind a builtin function into the namespace. DEPRECIATED.
+        Bind a builtin function into the namespace. DEPRECATED.
 
         This function will be depreciated in 0.7 and removed in 0.8.
         Use L{language.create_execution_context} instead to define all
@@ -278,10 +280,11 @@
 
     # -------------------------------------------------------------------------
 
+    @log.deprecated_f                       # Remove with 0.8
     def release (self):
         """
         Release an execution context: remove references in the namespace and
-        the like. DEPRECIATED.
+        the like. DEPRECATED.
 
         This function is not necessary any more.
         """

Modified: trunk/gnue-common/src/logic/adapters/python.py
===================================================================
--- trunk/gnue-common/src/logic/adapters/python.py      2010-12-02 22:27:05 UTC 
(rev 10258)
+++ trunk/gnue-common/src/logic/adapters/python.py      2010-12-02 23:29:23 UTC 
(rev 10259)
@@ -28,7 +28,7 @@
 Language adapter plugin for Python.
 """
 
-from gnue.common.base import errors
+from gnue.common.base import errors, log
 from gnue.common.logic import language
 from gnue.common.logic.adapters import Base
 
@@ -48,6 +48,7 @@
     # Create a new execution context
     # -------------------------------------------------------------------------
 
+    @log.deprecated_f                       # Remove with 0.8
     def createNewContext(self):
         """
         Create a python execution context
@@ -180,6 +181,7 @@
     # Depreciated functions
     # -------------------------------------------------------------------------
 
+    @log.deprecated_f                       # Remove with 0.8
     def bindObject(self, name, aObject, asGlobal = False):
         """
         Add an object to the local or global namespace.
@@ -191,6 +193,7 @@
 
     # -------------------------------------------------------------------------
 
+    @log.deprecated_f                       # Remove with 0.8
     def bindFunction(self, name, aFunction, asGlobal = False):
         """
         Add a function to the local or global namespace.
@@ -202,6 +205,7 @@
 
     # -------------------------------------------------------------------------
 
+    @log.deprecated_f                       # Remove with 0.8
     def bindBuiltin(self, name, anElement):
         """
         Bind the given element into the builtin-namespace.
@@ -248,8 +252,10 @@
         __self.__local_namespace['__parameters'] = params
 
         # FIXME: This allows the "self" parameter to be passed as a non-keyword
-        # argument. DEPRECATED.
+        # argument. DEPRECATED. Remove with 0.8
         if args:
+            log.deprecated("Calling a function with the self parameter as a "
+                    "non-keyword argument is deprecated.")
             __self.__local_namespace['__parameters']['self'] = args[0]
 
         try:

Modified: trunk/gnue-common/src/logic/language.py
===================================================================
--- trunk/gnue-common/src/logic/language.py     2010-12-02 22:27:05 UTC (rev 
10258)
+++ trunk/gnue-common/src/logic/language.py     2010-12-02 23:29:23 UTC (rev 
10259)
@@ -38,15 +38,11 @@
 from gnue.common.utils.FileUtils import dyn_import
 
 __all__ = ['AdapterNotFoundError', 'ImplementationError', 'CompileError',
-        'RuntimeError', 'AbortRequest', 'getLanguageAdapter',
-        'create_execution_context']
+        'RuntimeError', 'AbortRequest', 'create_execution_context']
 
 __plugins = {}                          # Cache for loaded plugins
 
-# for old function "getLanguageAdapter"
-__adapters = {}
 
-
 # -----------------------------------------------------------------------------
 # Exceptions
 # -----------------------------------------------------------------------------
@@ -158,40 +154,6 @@
             global_namespace, builtin_namespace)
 
 
-# -----------------------------------------------------------------------------
-# Get or create an instance of a given language adapter
-# -----------------------------------------------------------------------------
-
-def getLanguageAdapter(language):
-    """
-    Return a language adapter object for the given language. DEPRECIATED.
-
-    This function returns an execution context factory for the given language.
-
-    This function will be depreciated in 0.7 and removed in 0.8.
-
-    @param language: The language to return the language adapter object for.
-    @type language: string or unicode
-
-    @return: Language adapter object
-    @rtype: adapters.Base.LanguageAdapter
-
-    @raise AdapterNotFoundError: There is no language adapter available for the
-        given language.
-    """
-
-    lang = str(language.lower())
-  
-    if not __adapters.has_key(lang):
-        try:
-            module = dyn_import('gnue.common.logic.adapters.%s' % lang)
-        except ImportError:
-            raise AdapterNotFoundError, language
-        __adapters[lang] = module.LanguageAdapter()
-
-    return __adapters[lang]
-
-
 # =============================================================================
 # Self test code
 # =============================================================================
@@ -203,35 +165,6 @@
             print "My name is %s %s." % (my_name, name)
             return value * 2"""
 
-    print "*** Old (depreciated) interface ***"
-
-    print "Creating language adapter for 'python' ..."
-    adapter = getLanguageAdapter('python')
-
-    print "Creating new execution environment ..."
-    environ = adapter.createNewContext()
-    environ.shortname = "testing"
-
-    print "Setting up namespaces ..."
-    environ.bindObject('my_name', 'John')
-
-    print "Creating a new virtual code object ..."
-    method = environ.buildFunction('myFunctionName', code,
-            {'name': "", 'value': 0})
-
-    params = {'name': 'foo', 'value': 'bar'}
-    print "Calling function with: %s" % params
-    res = method(**params)
-    print "   result:", repr(res)
-
-    params = {'name': 'fooBar', 'value': 4}
-    print "Calling function with: %s" % params
-    res = method(**params)
-    print "   result:", repr(res)
-
-    print ""
-    print "*** New interface ***"
-
     print "Creating execution context for Python..."
     execution_context = create_execution_context(
             language = 'Python',


_______________________________________________
commit-gnue mailing list
commit-gnue@gnu.org
http://lists.gnu.org/mailman/listinfo/commit-gnue

Reply via email to