Giter Site home page Giter Site logo

Define custom variables about pyqt5ac HOT 4 CLOSED

ZanSara avatar ZanSara commented on June 2, 2024
Define custom variables

from pyqt5ac.

Comments (4)

addisonElliott avatar addisonElliott commented on June 2, 2024

Hello,

Great question, but alas I did not think that far ahead.

It's pretty easy to add new variables, you can see how I did it in the source code: https://github.com/addisonElliott/pyqt5ac/blob/master/pyqt5ac.py#L170-L172

PRs are welcome!

from pyqt5ac.

zkovari avatar zkovari commented on June 2, 2024

Hi Sara,

And would you like to override this variable through the command line in order to use the same config for different projects? Or why is it necessary to use a separate variable? Why not to just declare:

ioPaths:
  -
    - "my_project_name/gui/*.ui"
    - "my_project_name/generated/%%FILENAME%%_ui.py"

or even this should work (I didn't try though):

ioPaths:
  -
    - "*/gui/*.ui"
    - "%%DIRNAME%%/generated/%%FILENAME%%_ui.py"

But maybe I miss something.

from pyqt5ac.

ZanSara avatar ZanSara commented on June 2, 2024

What I am making at the moment is a template base PyQt5 application, so I expect the package name to be configurable to some degree. This said, my specific problem is in how I would like the *.qrc files to be compiled.
For example, I have this structure:

my_project/
`--- gui
     |--- resources
     |    |--- image.png
     |    `--- resources.qrc  <-- this one...
     |--- interface.ui
     `--- generated
          |---interface_ui.py
          `---resources_rc.py  <--- ...becomes this

This would translate, I guess, into this config file:

ioPaths:
  -
    - "*/gui/*.ui"
    - "%%DIRNAME%%/generated/%%FILENAME%%_ui.py"
  -
    - "*/resources/*.qrc"
    - "%%DIRNAME%%/../generated/%%FILENAME%%_ui.py"

Which, to be honest, starts to look confusing with respect to

variables:
  BASEDIR: `my_project`
ioPaths:
  -
    - "%%BASEDIR%%/gui/*.ui"
    - "%%BASEDIR%%/gui/generated/%%FILENAME%%_ui.py"
  -
    - "%%BASEDIR%%/gui/resources/*.qrc"
    - "%%BASEDIR%%/gui/generated/%%FILENAME%%_rc.py"

In addition, relative paths might cause trouble as, in most cases, the user wants the code generated from *ui files and *.qrc to fall in the same folder in order for the relative import to work.

Just my opinion. In addition, implementation seems trivial atm, I will send over a pull request soon.

from pyqt5ac.

zkovari avatar zkovari commented on June 2, 2024

@ZanSara thanks! PR was merged. I will add some finishing touches.

from pyqt5ac.

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.