Jump to content

Hanabi-san

Member
  • Posts

    14
  • Joined

  • Last visited

Posts posted by Hanabi-san

  1. I Just realized that I asked a really similar question about 2 years ago. Back then, I could not solve the problem. However, now I was able to include the PyNacl library by unzipping the PyNacl wheel file of my operating system and including this folder in my project plugin folder. Then, by using your suggested method, I import the library and then Cura is able to load the library correctly.

     

    Thank you for your help!

     

    Cheers

    • Like 1
  2. Thank you for your fast reply! I'm trying to import the PyNacl library (https://github.com/pyca/pynacl). When I use your suggested method, I get an error message saying, that PyNacl cannot find its own imports anymore. For instance, in the public.py file of the module, it calls "import nacl.bindings". But after I imported the modul in my project, I get an error message stating "No module named 'nacl'". Does that mean the PyNacl library is not compatible?

     

    Thanks and Cheers

  3. Hallo 

     

    I have created a custom plugin which uses a library, which is not included in Cura yet. When I run Cura from source, I can add the plugin to Cura, since I imported the library in my locally installed python. But when I add the plugin to the Cura Application, it does not work (it's an extension plugin and won't show up in the extensions menu).

     

    I would like to be able to add the plugin directly to the Cura Application instead of having to run Cura from source, since I plan to use it on multiple devices and setting up Cura from source is a lot of work. How can I do this? Do I have to build the new library somehow and add it to the Cura Application?

     

    Thanks and Cheers 

  4. @ctbeke Thank you for your fast reply. I tried using the import statement like in your example, but it does not seem to work. When I checked inside my Cura 4.4.1 application's UM folder inside the lib folder, there exists no Trust.py file. Could it be, that so far the cryptography library is only integrated in the Uranium Github repository but not in the downloadable application of Cura 4.4.1?

  5. Hallo

     

    I've heard, that Cura 4.4 has a cryptography library integrated. However, I am unable to find this library in Cura's lib folder. Could someone tell me, how Cura's cryptography library is called and which import statement I could use to use it in my self-written Cura plugin?

     

    Thank you!

  6. On 12/21/2019 at 12:44 PM, ghostkeeper said:

    Cryptography is already in the 4.4 build, so you can try it out there. We're going to use it for verifying signing keys of plug-ins installed from the Marketplace (though currently the Marketplace doesn't sign them yet).

    I am unable to find the cryptography library already integrated in Cura 4.4. Does anyone know under which name I can find the cryptography library in Cura's lib folder or which import statement I have to use?

  7. Cool, I didn't realize cryptography is already implemented in the 4.4 build. Then I try using the existing libraries of Cura for my plugin. That's even better, because I don't have to include the source code of the library in my own plugin folder.

     

    @ghostkeeper and @ahoeben Thank you very much for providing me with so many examples. Even though I couldn't use them for my desired cryptography library, I'm sure I can take advantage of them again when I want to use different kinds of libraries. 


     

  8. @ahoeben Thank you very much for your fast and detailed reply.

    1 hour ago, ahoeben said:

    On a general note: it is better not to put your plugins in the program bundle, but instead put it in the plugins folder in the configuration folder. The less you mess with the program bundle, the easier things are to restore if you make a mistake. And as a bonus, your plugin will be carried over to future versions of Cura.

    Yeah, that makes sense. I will do so.

     

    1 hour ago, ahoeben said:

    Here's another example, for when you need to load a module from a specific subfolder in your plugin:

    I've also tried this approach in my plugin. However, I encountered the same problem as described above in my previous post: It doesn't work for files that import other files in the same library but works perfectly fine for files that don't. Do I perhaps miss some setup steps?

  9. @ghostkeeper Thank you very much for your quick and detailed answer. I've now added the Python library source code folder to my plugin folder and imported the needed files like you described. It works well for library files that do not import anything from the same library folder. However, e.g. if I want to import a file x.py from the library "abc" and the file x.py includes the import statement "from abc import y", then it does not work anymore. Do you know why this happens and what I can do against it?

  10. Hallo

     

    I'm writing a plugin for Cura 4.3. I would like to use some external libraries in my plugin. However, when I use those libraries, Cura cannot read my plugin anymore (I added my plugin project folder to the plugin folder in the Cura applications contents folder).

    I noticed there is a "lib" folder in Cura's Resources. Is this the right location to add external libraries? Do I have to do it manually, or is there another option? Or if I'm wrong, how do I import or install external libraries into Cura?

     

    Thank you in advance!

×
×
  • Create New...