Giter Site home page Giter Site logo

Comments (4)

JLuebben avatar JLuebben commented on August 17, 2024

Thanks for the report.
That is a weird error. Can you post the full stack trace like this:

Traceback (most recent call last):
  File "F:/floppy/bin/Floppy.py", line 3, in <module>
    import floppy.main
  File "F:\floppy\floppy\main.py", line 1, in <module>
    from floppy.graph import Graph
  File "F:\floppy\floppy\graph.py", line 6, in <module>
    from floppy.node import ControlNode, Node, MetaNode, SubGraph
  File "F:\floppy\floppy\node.py", line 673, in <module>
    class ControlNode(Node):
  File "F:\floppy\floppy\node.py", line 690, in ControlNode
    a
NameError: name 'a' is not defined

You can of course remove the file paths

Unfortunately, development of new features was on hold for a while due to more pressing responsibilities. Creating nodes at runtime was the last thing I was working on and will be the first thing to get done. I will probably find time next month.

from floppy.

theshinyknight avatar theshinyknight commented on August 17, 2024

Sure, I am posting the stack trace here.

The steps were

  • Download the zip file
  • decompress it and rename the extracted folder
  • add the folder path to PYTHONPATH
  • open Python3 console and from floppy.node import Node, Input, Output, Tag, abstractNode, as described in the readme

Importing floppy works, but when I import from floppy.node, I get the import name error on ControlNode

>>> from floppy.node import Node, Input, Output, Tag, abstractNode Traceback (most recent call last): File "<stdin>", line 1, in <module> File ".../floppy/node.py", line 6, in <module> import floppy.graph File "...,/floppy/graph.py", line 6, in <module> from floppy.node import ControlNode, Node, MetaNode, SubGraph ImportError: cannot import name 'ControlNode'

Thanks for looking into the runtime creation of nodes; It would be useful to create nodes at runtime, especially if you are using Floppy as simple action executor.

from floppy.

JLuebben avatar JLuebben commented on August 17, 2024

I was able to reproduce the issue. My guess it that I have a cyclic dependency in my import statements and importing something 'from floppy.node' does not work if not 'floppy.graph' was imported first.
I will commit a fix soon.

Starting the editor directly via the script 'Floppy.py' in the 'bin' subdirectory should work.

from floppy.

theshinyknight avatar theshinyknight commented on August 17, 2024

Thanks for looking into this; I will give it a spin and see if swapping import statements works.

from floppy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.