Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ADict(dict):
- __setattr__ = dict.__setitem__
- __delattr__ = dict.__delitem__
- __getattr__ = dict.get
- LibEmpresa = ADict()
- def importar(empresa):
- libsImport = dict(
- Gol=dict(
- module='Gol.WSClient.SessionManagerClient_client',
- methodsDePara={
- "SMLocator": "SessionManagerClientLocator"
- }
- ),
- Azul=dict(
- module='Azul.WSClient.BWS_client',
- methodsDePara={
- "SMLocator": "BWSLocator"
- }
- ),
- )
- global LibEmpresa
- inf = libsImport[empresa]
- c = __import__(inf['module'])
- for i in dir(c):
- LibEmpresa[i] = getattr(c, i)
- for m in inf['methodsDePara']:
- LibEmpresa[m] = getattr(c, inf['methodsDePara'][m])
- importar('Gol')
- LibEmpresa.SMLocator(.....)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement