/[papo]/gnue/integrator/src/GIClient.py
ViewVC logotype

Diff of /gnue/integrator/src/GIClient.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by styxman, Fri Nov 8 16:57:51 2002 UTC revision 1.1.4.1 by anthonyl, Tue Mar 4 22:33:14 2003 UTC
# Line 16  Line 16 
16  # write to the Free Software Foundation, Inc., 59 Temple Place  # write to the Free Software Foundation, Inc., 59 Temple Place
17  # - Suite 330, Boston, MA 02111-1307, USA.  # - Suite 330, Boston, MA 02111-1307, USA.
18  #  #
19  # Copyright 2002 Free Software Foundation  # Copyright 2002-2003 Free Software Foundation
20  #  #
21  # FILE:  # FILE:
22  # GIClient.py  # GIClient.py
# Line 30  Line 30 
30  import os  import os
31  import sys  import sys
32  import string  import string
33    from GIParser import loadMapping
 from gnue.integrator.GIParser import loadMapping  
 from gnue.integrator import Actions  
34  from gnue.common import GDebug  from gnue.common import GDebug
35  from gnue.common.FileUtils import openResource  from gnue.common.FileUtils import openResource
36  from gnue.common import GDataObjects, GConnections  from gnue.common import GDataObjects, GConnections
# Line 49  class GIClient(GClientApp): Line 47  class GIClient(GClientApp):
47    COMMAND = "gnue-integrator"    COMMAND = "gnue-integrator"
48    NAME = "GNUe Integrator"    NAME = "GNUe Integrator"
49    USAGE = "[options] file"    USAGE = "[options] file"
50    COMMAND_OPTIONS = []    COMMAND_OPTIONS = [
51        [ 'testing','t','testing',1,None,None,
52          _("If you set this flag, Integrator won't write any data to ")+
53          _("destination datasources. ")]
54        ]
55    SUMMARY = \    SUMMARY = \
56       "GNUe Integrator is the data integration/migration tool of the GNU Enterprise system."       "GNUe Integrator is the data integration/migration tool of the GNU Enterprise system."
57    
# Line 72  class GIClient(GClientApp): Line 74  class GIClient(GClientApp):
74        mappingFile = self.ARGUMENTS[0]        mappingFile = self.ARGUMENTS[0]
75      except:      except:
76        self.handleStartupError ("No Integrator Definition File Specified.")        self.handleStartupError ("No Integrator Definition File Specified.")
77        
78        lh = NoLoginHandler()
79        self.getConnectionManager().setLoginHandler(lh)
80    
81      fileHandle = openResource(mappingFile)      fileHandle = openResource(mappingFile)
82      mapping = loadMapping (fileHandle)      mapping = loadMapping (fileHandle, self.connections)
83      fileHandle.close()      fileHandle.close()
84    
85    
86    
87      # add connections object to top object      if self.OPTIONS["testing"]:
88      mapping._connections=self.connections        mapping._testonly=1
89    
90        mapping.run()
91    
92    #
93    # Login handler for --batch mode
94    #
95    from gnue.common import GLoginHandler
96    class NoLoginHandler(GLoginHandler.LoginHandler):
97    
98      defaults = {'_username': 'jan', '_password': None}
99    
100      def getLogin(self, loginData, error):
101        val = {}
102        for prompt in loginData[2]:
103          if self.defaults.has_key(prompt[0])  and self.defaults[prompt[0]]:
104              val[prompt[0]] = self.defaults[prompt[0]]
105          else:
106              val[prompt[0]] = None
107        return val
108    
109      def destroyLoginDialog(self):
110          pass
111    
112    
113    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.4.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26