Jump to content
Developer Wiki and Function Reference Links ×

Encrypting Python Scripts that uses external libraries


GioPet

Recommended Posts

Hello, 

 

I have been working on a few Python Scripts that use third party libraries - for example BeautifulSoup4.

I intend to Encryption this script into a vsm plugin so that the external libraries are bound to it and can be used on other installations of Vectorworks.

 

I realised that the Encryption/Obfuscation method through Vectorworks is not able to bind the external packages into the vsm file:

I've included the path to these libraries in the Script Options and I am using the steps indicated by Vlado in this post for the related xml file.

ScriptOptions.thumb.png.2b288b169cdbc4d04e5335c296ec9b5e.png

 

<?xml version="1.0" encoding="UTF-8" standalone="no"?><!-- This file defines how the corresponding script plug-in should be packaged--><Plugin>
    <Package>
        <File>code/__init__.py</File>
        <File>bS4/</File>
        <File>bS4/__init__.py</File>
        <File>bS4/.py</File>
        <File>bS4/diagnose.py</File>
		<File>bS4/element.py</File>
		<File>bS4/testing.py</File>
		<File>bS4/builder/__init__.py</File>
		<File>bS4/builder/_html5lib.py</File>
		<File>bS4/builder/_htmlparser.py</File>
		<File>bS4/builder/_lxml.py</File>        
    </Package>
</Plugin>

 

Can any one advise on how to resolve this?

Thank you in advance.

 

Giovanni

 

 

Edited by GioPet
wrong image
Link to comment

Hi Giovanni,

 

normaly you don't need to declare any file that should go into the vsm.

When I remember correct theres also a folder tag that you can use <Folder>MyPythonPackage</Folder>.

 

I never tried to include an external lib into a vsm but you could look for the lib as usual package with py files and include these instead.

 

 

 

Edited by PatW
Link to comment

Hi Pat, 

 

thank you for your reply.

I have tried using the <Folder>MyPythonPackage</Folder>  but when I run the encrypted vsm in a Vectorworks installation that has no bs4 library installed, I get the following:

697561942_ScreenShot2018-10-25at10_09_52.thumb.png.df0be664b5628a8c17e73ce3b99e8521.png

 

So this is not working...

 

In my understanding, when you say 'look for the lib as usual package with py files and include these instead' isn't that done by adding all the py files of the library in the xml Package? in this way:

<File>bS4/</File>
<File>bS4/__init__.py</File>
<File>bS4/.py</File>
<File>bS4/diagnose.py</File>
<File>bS4/element.py</File>
<File>bS4/testing.py</File>
<File>bS4/builder/__init__.py</File>
<File>bS4/builder/_html5lib.py</File>
<File>bS4/builder/_htmlparser.py</File>
<File>bS4/builder/_lxml.py</File>    

thanks for your advice.

Giovanni

Link to comment

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.

×
×
  • Create New...