mazurov
11/16/2014 - 7:04 PM

MFiles with python

MFiles with python

cd /D z:\mfiles-report
venv\Scripts\activate.bat & ipython notebook --ip=10.211.55.3

# coding: utf-8

# In[20]:

from win32com.client import gencache
mfiles = gencache.EnsureModule('{B9C079AA-92DD-4FB4-A0E0-AA3198955B45}', 0, 1, 0)


# In[21]:

server = mfiles.MFilesServerApplication()


# In[22]:

server.Connect(AuthType=mfiles.constants.MFAuthTypeSpecificMFilesUser, UserName="",Password="", NetworkAddress="",Endpoint="2266")


# In[24]:

server_vaults = server.GetVaults()
for vault in server_vaults:
    print(vault.Name)


# In[29]:

first = server_vaults.Item(1).LogIn()


                first.GetGUID()
                
# In[43]:

for svault in server_vaults:
    vault = svault.LogIn()
    print("*" * 80)
    print(svault.Name)
    for cl in first.ClassOperations.GetAllObjectClasses():
        print(" " * 4 + cl.Name)
        for prop_id in cl.AssociatedPropertyDefs:
            prop = vault.PropertyDefOperations.GetPropertyDef(prop_id.PropertyDef)
            print(" " * 8 + str(prop.Name))