def main(): esp = espControl() import inspect from debug import TDB tdb = TDB() printFD = tdb.printFuncDict printFD(inspect.getmembers(esp)) print(esp.getPos()) print(esp.getErr())
except: #FIXME this is not accurate... #for linux print('out not import ctypes.wintypes assuming linux') import sys import select import tty import termios from debug import TDB,ploc try: import rpdb2 except: pass from rig.ipython import embed tdb=TDB() printD=tdb.printD printFD=tdb.printFuncDict tdb.off() def kl_lin(charBuffer,keyHandler,keyLock,termInfoSet): #FIXME does not work properly with ipython :/ #FIXME still has problems with c-ctrl old_settings = termios.tcgetattr(sys.stdin) #functions to pass to the callback for managing ipython off=lambda:termios.tcsetattr(sys.stdin, termios.TCSADRAIN, old_settings) on=lambda:tty.setcbreak(sys.stdin.fileno()) termInfoSet(off,on) try:
##The keybinding dictionaries themselves! #functions can help contain stuff and assemble EVEN LONGER sequences from debug import TDB #import rpdb2 #rpdb2.settrace() tdb = TDB() printD = tdb.printD printFuncDict = tdb.printFuncDict tdb.off() #XXX WARNING XXX Spagetti code be here! some day we will refactor keyRequesters_special = {} #FIXME nasty use of globals >_< def dictInit( inDict, clsDict, kr_dict ): #putting this here makes everything funny but auto catches errors """the only EXTERNAL dicts that should be put in here are ikCtrlDicts ie in=initilized""" def parseValue(counter, instanceOfClass, putativeFunc, keyRequesters, kr_dict): """Recursive parser for keybinding dictionaries that binds the named function to the method it initilizes to?, only works because I'm using classes""" #FIXME might be able to simplify this by simply referring to functions? and getting rid of the classes? eh, but inheritance man... if counter > 100: #this should be longer than the longest program list you try to pass in return None, None key_request_count = 0 try: #'function name' if putativeFunc in keyRequesters: #see if this is a key requester key_request_count += 1
from ctypes import * from time import sleep import inspect as ins import os #import rpdb2 #rpdb2.settrace() try: from debug import TDB,ploc tdb=TDB() printD=tdb.printD printFD=tdb.printFuncDict tdbOff=tdb.tdbOff #tdbOff() except: printD=print printFD=print #developed for api version 1.0.0.7 #class based version of the mcc msg python wrapper """HOW TO USE: from mccpy import mccmsg mcc=mccmsg YOU MUST CALL cleanup() ON YOUR OWN if there are no erros then the object has dected all the mcs and is set on the first use selectMC(num) num [0:n-1] where n=num multiclamps use FindFirst and FindNext to find the multiclamps,