def set_host_map(self): self.remote_user='******' #obj=self.args_panel.obj if 1: #obj.has_key('host_map'): #host_map_loc= obj['host_map'][1].GetValue() if os.path.exists(self.host_map_loc): self.host_map_loc=os.path.realpath(self.host_map_loc) #print self.host_map_loc assert os.path.isfile(self.host_map_loc), 'Host mapping file "%s" does not exists.' % self.host_map_loc hm=import_module(self.host_map_loc) self.mapping=hm.mapping
def set_host_map(self): self.remote_user = '******' #obj=self.args_panel.obj if 1: #obj.has_key('host_map'): #host_map_loc= obj['host_map'][1].GetValue() #if os.path.exists(self.host_map_loc): self.host_map_loc = os.path.realpath(self.host_map_loc) #print self.host_map_loc assert os.path.isfile( self.host_map_loc ), 'Host mapping file "%s" does not exists.' % self.host_map_loc hm = import_module(self.host_map_loc) self.mapping = hm.mapping
#print args.copy_vector #db=None target = source = None from_db, to_db = args.copy_vector.split(_to) #print from_db, to_db #pprint (inc) if inc.has_key(to_db.upper()): import __builtin__ __builtin__.args = args dmhome = os.path.dirname(os.path.realpath(__file__)) #print os.path.join(dmhome,'include',inc[to_db.upper()]) #e(0) #print to_db.upper() #print os.path.join(dmhome,'include',inc[to_db.upper()]) target = import_module( os.path.join(dmhome, 'include', 'etl', inc[to_db.upper()])) #print db if inc.has_key(from_db.upper()): import __builtin__ __builtin__.args = args dmhome = os.path.dirname(os.path.realpath(__file__)) #print os.path.join(dmhome,'include',inc[from_db.upper()]) #e(0) module_file = os.path.join(dmhome, 'include', 'etl', inc[from_db.upper()]) #print module_file source = import_module(module_file) #print db #pprint(dir(db)) #print target #print source #e(0)
inc['SYASE'] = inc['SYANY'] = inc['SYIQ'] = 'sybase.py' inc['ORA'] = inc['EXAD'] = 'oracle.py' inc['ORAXE'] = 'oraxe.py' #print inc print args.copy_vector target = None from_db, to_db = args.copy_vector.split('2') if inc.has_key(to_db.upper()): import __builtin__ __builtin__.args = args dmhome = os.path.dirname(os.path.realpath(__file__)) target = import_module(os.path.join(dmhome, 'include', inc[to_db.upper()])) abspath = os.path.abspath(os.path.dirname(sys.argv[0])) ts = datetime.datetime.now().strftime('%Y%m%d_%H%M%S_%f') logdir = os.path.join(abspath, 'logs') spooldir = os.path.join(logdir, 'data') datadir = os.path.join(logdir, ts) ##default export location if not provided as command line arg TIMESTAMPED_TO_DIR = True TIMESTAMPED_TO_FILE = True #print from_db, to_db #print args.to_file #print args.to_dir #e(0)
def loadProfile(self, profile_loc): assert os.path.isfile( profile_loc), 'sqloader config file %s does not exists.' % ( profile_loc) lc = import_module(profile_loc) return lc.sqlloader_config
import paramiko import zipfile import datetime #from config.include.ssh_file import SSHConnection import shutil import re import pprint as pp import errno from common.v101.exceptions import RowCountError import imp if 0: from common.v101.loaders import import_module d = os.path.split( os.path.split(os.path.split(os.path.dirname(__file__))[0])[0])[0] hmap = import_module(os.path.join(d, 'include', 'v101', 'host_map.py')) print hmap e(0) def import_module(filepath): class_inst = None #expected_class = 'MyClass' mod_name, file_ext = os.path.splitext(os.path.split(filepath)[-1]) assert os.path.isfile(filepath), 'File %s does not exists.' % filepath if file_ext.lower() == '.py': py_mod = imp.load_source(mod_name, filepath) elif file_ext.lower() == '.pyc': py_mod = imp.load_compiled(mod_name, filepath)
#print args.copy_vector #db=None target=source=None from_db, to_db=args.copy_vector.split(_to) #print from_db, to_db #pprint (inc) if inc.has_key(to_db.upper()): import __builtin__ __builtin__.args = args dmhome=os.path.dirname(os.path.realpath(__file__)) #print os.path.join(dmhome,'include',inc[to_db.upper()]) #e(0) #print to_db.upper() #print os.path.join(dmhome,'include',inc[to_db.upper()]) target = import_module(os.path.join(dmhome,'include',inc[to_db.upper()])) #print db if inc.has_key(from_db.upper()): import __builtin__ __builtin__.args = args dmhome=os.path.dirname(os.path.realpath(__file__)) #print os.path.join(dmhome,'include',inc[from_db.upper()]) #e(0) source = import_module(os.path.join(dmhome,'include',inc[from_db.upper()])) #print db #pprint(dir(db)) #print target #print source #e(0) abspath=os.path.abspath(os.path.dirname(sys.argv[0]))
import types e = sys.exit #ddb='MRR_BI' #duser='******' from db_utils import query from common.v101.loaders import import_module #import config.include.etl.oracle as ora import __builtin__ from subprocess import Popen, PIPE import wx.lib.agw.pybusyinfo as PBI home = os.path.abspath(os.path.dirname(sys.argv[0])) print home #e(0) editor_file = os.path.join(home, 'include', 'sql_editor.py') editor = import_module(editor_file) if __name__ == "__main__": """ d = showmsg() time.sleep(3) d = None sys.exit(0) """ import sys from wx.lib.mixins.inspection import InspectableApp app = InspectableApp(False) frame = editor.Main(None, sys.stdout) frame.Show(True) #import wx.lib.inspection #wx.lib.inspection.InspectionTool().Show()
inc['SYASE']=inc['SYANY']=inc['SYIQ']='sybase.py' inc['ORA11G']=inc['ORAEXA']='oracle.py' inc['ORAXE']='oraxe.py' #print inc print args.copy_vector db=None from_db, to_db=args.copy_vector.split('2') if inc.has_key(to_db.upper()): import __builtin__ __builtin__.args = args dmhome=os.path.dirname(os.path.realpath(__file__)) db = import_module(os.path.join(dmhome,'include',inc[to_db.upper()])) abspath=os.path.abspath(os.path.dirname(sys.argv[0])) ts=datetime.datetime.now().strftime('%Y%m%d_%H%M%S_%f') logdir=os.path.join(abspath,'logs') spooldir=os.path.join(logdir,'data') datadir= os.path.join(logdir,ts) ##default export location if not provided as command line arg TIMESTAMPED_TO_DIR = True TIMESTAMPED_TO_FILE = True #print from_db, to_db #print args.to_file #print args.to_dir #e(0)
inc["ORA"] = inc["EXAD"] = "oracle.py" inc["ORAXE"] = "oraxe.py" # print inc print args.copy_vector target = None from_db, to_db = args.copy_vector.split("2") if inc.has_key(to_db.upper()): import __builtin__ __builtin__.args = args dmhome = os.path.dirname(os.path.realpath(__file__)) target = import_module(os.path.join(dmhome, "include", inc[to_db.upper()])) abspath = os.path.abspath(os.path.dirname(sys.argv[0])) ts = datetime.datetime.now().strftime("%Y%m%d_%H%M%S_%f") logdir = os.path.join(abspath, "logs") spooldir = os.path.join(logdir, "data") datadir = os.path.join(logdir, ts) ##default export location if not provided as command line arg TIMESTAMPED_TO_DIR = True TIMESTAMPED_TO_FILE = True to_dir = r"C:\tmp\dm_out" if TIMESTAMPED_TO_DIR: to_dir = os.path.join(to_dir, ts) if not os.path.isdir(to_dir):