Exemplo n.º 1
0
 def OnChangeText(self, evt):
     # status on text thange
     #print 'OnChangeText', self.changed, self.ignore_change
     if not self.changed:
         if not self.ignore_change:
             self.changed = True
             print 'sending "star_tab_name"'
             #Publisher().sendMessage( "star_tab_name", (self.ID) )
             send("star_tab_name", (self.ID))
	def OnChangeText(self, evt):
		# status on text thange
		#print 'OnChangeText', self.changed, self.ignore_change
		if not self.changed:
			if not self.ignore_change:
				self.changed=True		
				print 'sending "star_tab_name"' 
				#Publisher().sendMessage( "star_tab_name", (self.ID) )
				send("star_tab_name", (self.ID))
Exemplo n.º 3
0
    def OnKeyPressed(self, event):
        if self.CallTipActive():
            self.CallTipCancel()
        key = event.GetKeyCode()

        if key == 32 and event.ControlDown():
            pos = self.GetCurrentPos()

            # Tips
            if event.ShiftDown():
                self.CallTipSetBackground("yellow")
                self.CallTipShow(
                    pos, 'lots of of text: blah, blah, blah\n\n'
                    'show some suff, maybe parameters..\n\n'
                    'fubar(param1, param2)')
            # Code completion
            else:
                #lst = []
                #for x in range(50000):
                #    lst.append('%05d' % x)
                #st = " ".join(lst)
                #print len(st)
                #self.AutoCompShow(0, st)

                kw = keyword.kwlist[:]
                kw.append("zzzzzz?2")
                kw.append("aaaaa?2")
                kw.append("__init__?3")
                kw.append("zzaaaaa?2")
                kw.append("zzbaaaa?2")
                kw.append("this_is_a_longer_value")
                #kw.append("this_is_a_much_much_much_much_much_much_much_longer_value")

                kw.sort()  # Python sorts are case sensitive
                self.AutoCompSetIgnoreCase(False)  # so this needs to match

                # Images are specified with a appended "?type"
                for i in range(len(kw)):
                    if kw[i] in keyword.kwlist:
                        kw[i] = kw[i] + "?1"

                self.AutoCompShow(0, " ".join(kw))
        else:
            send('value_changed', ())
            event.Skip()
Exemplo n.º 4
0
	def OnKeyPressed(self, event):
		if self.CallTipActive():
			self.CallTipCancel()
		key = event.GetKeyCode()
		
		if key == 32 and event.ControlDown():
			pos = self.GetCurrentPos()

			# Tips
			if event.ShiftDown():
				self.CallTipSetBackground("yellow")
				self.CallTipShow(pos, 'lots of of text: blah, blah, blah\n\n'
								 'show some suff, maybe parameters..\n\n'
								 'fubar(param1, param2)')
			# Code completion
			else:
				#lst = []
				#for x in range(50000):
				#    lst.append('%05d' % x)
				#st = " ".join(lst)
				#print len(st)
				#self.AutoCompShow(0, st)

				kw = keyword.kwlist[:]
				kw.append("zzzzzz?2")
				kw.append("aaaaa?2")
				kw.append("__init__?3")
				kw.append("zzaaaaa?2")
				kw.append("zzbaaaa?2")
				kw.append("this_is_a_longer_value")
				#kw.append("this_is_a_much_much_much_much_much_much_much_longer_value")

				kw.sort()  # Python sorts are case sensitive
				self.AutoCompSetIgnoreCase(False)  # so this needs to match

				# Images are specified with a appended "?type"
				for i in range(len(kw)):
					if kw[i] in keyword.kwlist:
						kw[i] = kw[i] + "?1"

				self.AutoCompShow(0, " ".join(kw))
		else:
			send('value_changed',())
			event.Skip()
Exemplo n.º 5
0
def execRemoteCmd(specs, worker, panel_id):
    import paramiko, sys

    ssh = paramiko.SSHClient()
    ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
    (username, password, hostname) = tc_host[tc_srv]
    ssh.connect(hostname, username=username, password=password)
    #ssh.exec_command( 'ls -al' )
    #stdin,stdout,stderr = ssh.exec_command("cd /opt/etl/apps/smart_dev/volumes/etl/scripts/tab_copy;. ./.ora_profile;./run.sh t tab_copy;")
    cmd = 'time python tc.py --pipeline_spec=%s --pipeline=%s;' % (specs,
                                                                   worker)
    #print cmd
    #print specs
    #print worker
    #sys.exit(1)
    stdin, stdout, stderr = ssh.exec_command(
        "cd /opt/etl/apps/smart_dev/volumes/etl/scripts/tab_copy;. ./.ora_profile;%s"
        % cmd)

    #time python tc.py --pipeline_spec=pipeline/posix/pipeline_spec.xml --pipeline=clients/table_copy/tab_copy/tc_t.xml

    #stdin,stdout,stderr = ssh.exec_command("pbrun voletlusr")

    out = stdout.read()
    if out:
        if '** FATAL **' in out or '** ERROR **' in out or 'ERROR in line' in out or '## ERROR **' in out:
            #Publisher().sendMessage( "append_err", (out,(0,1),panel_id) )
            send("append_err", (out, (0, 1), panel_id))
            return ([], out)
        else:
            #Publisher().sendMessage( "append_log", (out,(0,1),panel_id) )
            send("append_log", (out, (0, 1), panel_id))
    err = stderr.read()
    pprint(err)
    if len(err.split(
            '\n')) == 5 and 'real' in err and 'user' in err and 'sys' in err:
        #Publisher().sendMessage( "append_log", (err,(0,1),panel_id) )
        send("append_log", (err, (0, 1), panel_id))
        err = []
    #sys.exit(0)
    if err:
        print '#' * 40
        print err.strip()
        print '#' * 40
        #Publisher().sendMessage( "append_err", ( err,(0,1),panel_id) )
        send("append_err", (err, (0, 1), panel_id))
    #sys.exit(1)

    return (out, err)
Exemplo n.º 6
0
def execRemoteCmd(specs, worker,panel_id):
	import paramiko, sys

	ssh = paramiko.SSHClient()
	ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
	(username, password, hostname) = tc_host[tc_srv]
	ssh.connect(hostname, username=username, password = password )
	#ssh.exec_command( 'ls -al' )	
	#stdin,stdout,stderr = ssh.exec_command("cd /opt/etl/apps/smart_dev/volumes/etl/scripts/tab_copy;. ./.ora_profile;./run.sh t tab_copy;")
	cmd='time python tc.py --pipeline_spec=%s --pipeline=%s;' % (specs, worker)
	print cmd
	print specs
	print worker
	#sys.exit(1)
	stdin,stdout,stderr = ssh.exec_command("cd /opt/etl/apps/smart_dev/volumes/etl/scripts/tab_copy;. ./.ora_profile;%s" % cmd)
	
	#time python tc.py --pipeline_spec=pipeline/posix/pipeline_spec.xml --pipeline=clients/table_copy/tab_copy/tc_t.xml

	
	#stdin,stdout,stderr = ssh.exec_command("pbrun voletlusr")

	out= stdout.read()
	if out:
		if '** FATAL **' in out or '** ERROR **' in out or  'ERROR in line' in out or '## ERROR **' in out:
			#Publisher().sendMessage( "append_err", (out,(0,1),panel_id) )
			send("append_err", (out,(0,1),panel_id))
			return ([],out)
		else:
			#Publisher().sendMessage( "append_log", (out,(0,1),panel_id) )	
			send("append_log", (out,(0,1),panel_id) )
	err= stderr.read()
	pprint(err)
	if len(err.split('\n'))==5 and 'real' in err and 'user' in err and 'sys' in err:
		#Publisher().sendMessage( "append_log", (err,(0,1),panel_id) )
		send("append_log", (err,(0,1),panel_id) )
		err=[]		
	#sys.exit(0)
	if err:
		print '#'*40
		print err.strip()
		print '#'*40
		#Publisher().sendMessage( "append_err", ( err,(0,1),panel_id) )	
		send( "append_err", ( err,(0,1),panel_id) )
	#sys.exit(1)
	
	return (out,err)
Exemplo n.º 7
0
	def log(self,msg,pos=None):
		assert pos, 'pos is not set'
		send( "append_browser_log", (msg,pos) )
Exemplo n.º 8
0
	def err(self,msg,pos=None):
		#Publisher().sendMessage( "append_browser_err", (msg,pos ))
		#print 'sending append_browser_err from blog'
		assert pos, 'pos is not set'
		send("append_browser_err", (msg,pos ))
Exemplo n.º 9
0
def log_del(msg,  panel_id=None):
	#wx.LogMessage(msg)
	#Publisher().sendMessage( "append_log", (msg,(0,1),panel_id) )	
	send( "append_log", (msg,(0,1),panel_id) )
Exemplo n.º 10
0
	def err(self,msg,  panel_id=None):
		#Publisher().sendMessage( "append_err", (msg,(0,1),panel_id) )
		assert panel_id, 'panel_id is not set'
		send( "append_err", (msg,(0,1),panel_id) )
Exemplo n.º 11
0
        print 'dbi.opError'
        status = 1
        err = e
    else:
        #print 'Undefined odb = odbc.odbc(cs) error.'
        status = 0
        #err=e

    if err:
        printerr(err)
        print status
        #blog.err(str(err),pos)
        #blog.err(str(err),pos)
        #Publisher().sendMessage( "go_up", pos )
        if pos:
            send("go_up", pos)

    else:
        cur = odb.cursor()
        #pprint(sql);
        print '=' * 60
        print(sql)
        print '-' * 60
        status = 0
        rowcount = 0

        err = ''
        i = 1

        try:
            status = cur.execute("%s" % sql)  #'SELECT * FROM DUAL'
Exemplo n.º 12
0
 def log(self, msg, pos=None):
     assert pos, 'pos is not set'
     send("append_browser_log", (msg, pos))
Exemplo n.º 13
0
 def err(self, msg, pos=None):
     #Publisher().sendMessage( "append_browser_err", (msg,pos ))
     #print 'sending append_browser_err from blog'
     assert pos, 'pos is not set'
     send("append_browser_err", (msg, pos))
Exemplo n.º 14
0
def log_del(msg, panel_id=None):
    #wx.LogMessage(msg)
    #Publisher().sendMessage( "append_log", (msg,(0,1),panel_id) )
    send("append_log", (msg, (0, 1), panel_id))
Exemplo n.º 15
0
 def err(self, msg, panel_id=None):
     #Publisher().sendMessage( "append_err", (msg,(0,1),panel_id) )
     assert panel_id, 'panel_id is not set'
     send("append_err", (msg, (0, 1), panel_id))