Jump to content
Developer Wiki and Function Reference Links Read more... ×
GioPet

Encrypting Python Scripts that uses external libraries

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

Share this post


Link to post

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

Share this post


Link to post

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

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

 

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.

×