Jump to content
Sign in to follow this  
BillW

Encrypting python based tools

Recommended Posts

I have a set of menu commands and tools that I have written in python with all the code for each contained within the respective Script Editor window ie no external code import/modules etc.

I thought I would try and encrypt (ie PC ctrl+alt+shift with capslock set) a simple menu command "Test menu" containing code vs.AlrtDialog('Menu command')

I get an error "Test menu.xml" not found. I understand from previous posts that the xml must exist if the form

Common/__init__.py

Common/Vector.py

Common/Utilities.py

Common/ObjsType.py

MyDialog.py

MainProgram.py

but if I have no external files ie code is totally encapsulated. what do I put in the xml file??

see attached

Thanks

Share this post


Link to post

In my case the modules are in a folder (no package) named code. The folder lies in the same directory like the vms.

I tried:



code/main.py
code/vw_lib.py



and


code/main.py
code/vw_lib.py


Both xmls didn't work - no error shows up.

Share this post


Link to post

Your top attempt is correct, but with one exception. In python, having includes in a directory organizes them into a package -- they way they are packaged with "code/," you would call include code.main.py For this to work, you would need a (potentially) blank file in code names "__init__.py" and to include than in your package xml.

Alternatively, as you indicate you aren't organizing into packages, you need VW to strip "code/" from the included file names. You can do this with the Path attribute, so in your case:

Note, the attribute names are case sensitive.

-Josh

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...