addisonElliott / pyqt5ac

Python module to automatically compile UI and QRC files in PyQt5 to Python files
MIT License
11 stars 4 forks source link

Paths are not relative to the configuration file #36

Open ZanSara opened 4 years ago

ZanSara commented 4 years ago

I just stumbled upon this behavior. My main script contains this line:

pyqt5ac.main(config=os.path.join(os.path.dirname(os.path.realpath(__file__)), 'pyqt5ac.yml'))

and my pyqt5ac.yml is the following:

variables:
  BASEDIR : "be_bi_pyqt_template"
ioPaths:
  -
    - "%%BASEDIR%%/resources/*.ui"
    - "%%BASEDIR%%/resources/generated/ui_%%FILENAME%%.py"
  -
    - "%%BASEDIR%%/resources/*/*.qrc"
    - "%%BASEDIR%%/resources/generated/%%FILENAME%%_rc.py"
uic_options: --from-imports
force: False

The two files are siblings.

When I run main from the same folder that contains the two files, I get:

Skipping example_widget, up to date

When I run main from any other folder, I get:

No items found in be_bi_pyqt_template/resources/*.ui
No items found in be_bi_pyqt_template/resources/*/*.qrc

I am looking into this issue now, as it is rather critical for me. Expect a PR soon.

zkovari commented 4 years ago

I see, thanks for reporting. Yes, I believe the locations should be relative to the configuration file.

It's unspecified what was the original expectation from pyqtac5, so now let's address this as an added feature ;)