Giter Club home page Giter Club logo

pycirkuit's People

Contributors

aniolm9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pycirkuit's Issues

Define a place for executable files inside the code tree

For PyCirkuit to work seamlessly on Windows, a controlled place should be defined to put there the aux. windows executables, like m4.exe and dpic.exe

This could be, for instance, a lib/ directory inside the topmost tree dir. The code should add this directory to the system PATH

App doesn't warn trying to export into a directory with no write permissions

Describe the bug
Now PyCirkuit is programmed to export the generated TikZ code into the same directory where the source file resides. This is normally what the user wants

To Reproduce
Steps to reproduce the behavior:

  1. Run PyCirkuit
  2. Open a source file residing in a read-only directory
  3. Process the source file and click on the "Export" button
  4. File isn't saved without informing the user

Expected behavior
Warn user about trying to write into a read-only dir, and ask for an alternative location, or cancel the operation.

Desktop (please complete the following information):

  • OS: Debian GNU/Linux 9.8
  • Python version 3.5]
  • PyCirkuit version 0.2.0
  • How did you obtain PyCirkuit: Debian package
  • Did you install PyCirkuit in a Python Virtual Environment as described in the README file? No

(Bug reported by Aniol Martí)

Downloading Circuit Macros is a potential security problem

Describe the bug
When the program (in GUI mode) does not find the Circuit Macros installed on the system, it ask the user whether it has to download them or not. If so, it doesn't check the GPG signature or equivalent.

Expected behavior
Some sort of authorship checking would be desirable.

Desktop (please complete the following information):

  • OS: [e.g. Debian GNU/Linux v10.0]
  • Python version [e.g. 3.7]
  • PyCirkuit version [e.g. 0.4.0]
  • How did you obtain PyCirkuit? GitHub repo
  • Did you install PyCirkuit in a Python Virtual Environment as described in the README file? YES

Files included from whitin source code are searched with Temporary directory as base

Describe the bug
Suppose you have a source file with this minimal example code, where the file "pz.lib" is a library containing some own-defined macros, located into the same directory as your source file:

.PS
include(pz.lib)
.PE

Then the compilation will fail complaining that the file "pz.lib" is not found. The reason is that the source file is copied into a temporary dir and processed there, but the files it depends from are not.

Expected behavior
The included file should be found, at least if it's located into the same directory where the source file is.

Possible solution (to be tested)
The "include"keyword is a M4 directive. M4 searches files into the current dir and the directories passed after "-I" command-line flag. We can perhaps append the source file directory there.

PyCirkuit does not reprocess the file after correcting a bug in the middle of a CLI batch processing.

Description
PyCirkuit does not reprocess the file after correcting a bug in the middle of a CLI batch processing.
Apparently, the corrected source file is not copied into the internal temporary directory PyCirkuit uses for processing.

To Reproduce
Steps to reproduce the behavior:

  1. Process a bunch of source files (one or more containing errors) and select more than one output format (-t -p -f, for instance)
  2. When an erroneus file is encountered, the process stops and the user is asked what to do. Choose to open pycirkuit GUI to try to resolve the issue manually.
  3. Fix the error in file, check that the source can be converted without errors, save the corrected file and exit pycirkuit GUI.
  4. User is asked again and again what to do with the erroneous file.

Desktop

  • OS: Debian GNU/Linux v10
  • Python version 3.7
  • PyCirkuit version 0.3.2
  • How did you obtain PyCirkuit? GitHub repo.
  • Did you install PyCirkuit in a Python Virtual Environment as described in the README file? YES

Export TikZ not working if input file is not .ckt

Describe the bug
When clicking "Export to TikZ" no file is created in the working directory, though the program thinks it has, as if you click again it says that the file already exists.

To Reproduce
Steps to reproduce the behavior:

  1. Open PyCirkuit.
  2. Open an example.
  3. Save the example as "foo" in your home directory.
  4. Click "Export to TikZ".

Expected behavior
A foo.tikz file should be created.

Actual behavior
No file is created and a window saying that the file already exists pops up.

Desktop:

  • OS: Debian GNU/Linux v9.8
  • Python version 3.6
  • PyCirkuit version 0.2.1
  • How did you obtain PyCirkuit: Debian package

Additional context
Doing the same but in 3 saving the file as "foo.ckt" works.

Circuit Macros are uncompressed to a wrong directory

Describe the bug
When opening PyCirkuit, if the circuit-macros Debian package is not installed, PyCirkuit tries to download them as expected. However, they are downloaded and uncompressed to ~/.local/share/PyCirkuit/pycirkuit/circuit_macros and PyCirkuit looks at ~/.local/share/PyCirkuit/pycirkuit/circuit-macros

To Reproduce
Steps to reproduce the behavior:

  1. Install PyCirkuit as described in the README.
  2. Open an example circuit.
  3. Say "Yes" to the Circuit Macros download.
  4. See error

Expected behavior
PyCirkuit should find the Circuit Macros and generate a preview of the example.

Desktop (please complete the following information):

  • Debian GNU/Linux v9.8
  • Python 3.5.3
  • PyCirkuit 0.2.2
  • PyPi inside a venv.

Install copies unnecessary source files

Files at L10n/ and doc/ directory are installed by setup along with the rest of the python code.

These files are only relevant at developing time and therefore aren't necessary in a working environment.

Store metadata within source file

Storing some metadata within source file has a lot of potential useful applications:

  • Allows the use of specific LaTeX templates for specific files
  • Can store the pre- and post- processing that must be applied to a file
  • ...

Probably the best way to implement this is via "Magic Comments", in a similar way that is done by TeX Studio, for instance.

Pycirkuit crashes when setting a directory in LaTeX Template File

System information

Debian 9.7
Python 3.5.3

Expected behaviour

An error window should be displayed saying that setting a directory is not allowed.

Actual behaviour

Pycirkuit crashes with the following error:

Traceback (most recent call last):
  File "/opt/pycirkuit/venv/lib/python3.5/site-packages/pycirkuit/mainwindow.py", line 411, in on_processButton_clicked
    if not self._check_templates():
  File "/opt/pycirkuit/venv/lib/python3.5/site-packages/pycirkuit/mainwindow.py", line 134, in _check_templates
    with open(template, 'r') as t:
IsADirectoryError: [Errno 21] Is a directory: '/opt/pycirkuit/venv/lib/python3.5/site-packages/pycirkuit/templates'

Reproduce the behaviour

Set a directory in the field LaTeX Template File. Then, click the button Process and display.

[BUG] error: invalid command 'bdist_wheel'

Describe the bug
PyCirkuit fails to install using pip under some conditions (see below).

To Reproduce
Steps to reproduce the behavior:

  1. Install PyCirkuit from master.
  2. Download the ZIP file from develop.
  3. Install from the ZIP file.
  4. See error.

Expected behavior
PyCirkuit should be installed.

Desktop:

  • OS: Debian GNU/Linux v9.9
  • Python version 3.5.3
  • PyCirkuit devel

Exporting to a write-protected dir should ask for alternate location

Describe the bug
By default, the "Export to TikZ" button tries to export into the same directory where the source file resides. If the latter is located into a read-only directory (which is a typicar situation if user opened one of the examples distributed with the debian package) the operation fails but user is NOT asked for an alternate location.

The only workaround is to copy the example into a writable location and open that copy, but this information is not offered to the user.

To Reproduce
Steps to reproduce the behavior:

  1. Open a .ckt example located into a read-only location
  2. Process the drawing and try to export it. An error is triggered.

Expected behavior
If cannot export due to file permissions, program should ask for an alternate location.

Desktop (please complete the following information):

  • OS: all
  • Python version: doesn't matter
  • PyCirkuit version: 0.2.1
  • How did you obtain PyCirkuit: debian package

Scroll bars in preview and in text editor have different styles

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Load/Create a drawing, with code long enough to make scroll bar appear in the editor widget.
  2. If image isn't large enough, zoom it (Ctrl+mouse wheel) until it is and scroll bars appear in the preview widget.
  3. See the different style of the scroll bars.

Expected behavior
Same style, obviously.

Desktop (please complete the following information):

  • OS: Confirmed on GNU/Linux and Windows
  • Python version: 3.5-3.7
  • PyCirkuit version: development version

Weird path for circuit macros

When running Pycirkuit for the first time, circuit macros are downloaded in ~/.local/share/UPC/pycirkuit/circuit_macros. I think it would be better to change it to: ~/.local/share/pycirkuit/circuit_macros as it is a more usual path.

Asking for CM/Dpic manual does not work on windows

Branch: develop

Invoking either the first or second menu options in the 'Help' menu does not work in windows. Perhaps the manuals aren't correctly found or the associate application isn't correctly invoked.

Circuit schematic window doesn't resize when it is located in a side

Describe the bug
The window containing the circuit schematic can be moved in 4 different positions: top, bottom, left and right. If this window is in one of the sides (right or left) and you use Ctrl+Mouse to zoom the window does not resize, but in the top or bottom it does.

To Reproduce
Steps to reproduce the behavior:

  1. Open PyCirkuit.
  2. Open a ckt example.
  3. Move the window to the right or left.
  4. Zoom.
  5. See error

Expected behavior
The window should resize as it does when it is located at top or bottom.

Desktop (please complete the following information):

  • OS: Debian GNU/Linux v9.8.
  • Python 3.5.3.
  • PyCirkuit develop branch.
  • pip3 install --upgrade https://github.com/orestesmas/pycirkuit/archive/develop.zip
  • PyCirkuit is installed inside a venv.

Pycirkuit crashes when trying to export to TIkZ

System information

Debian 9.7
Python 3.5.3

Expected behaviour

A dialog displaying the TIkZ code or asking where to save the TIkZ file should appear.

Actual behaviour

Pycirkuit crashes with the following error:

Traceback (most recent call last):
  File "/opt/pycirkuit/venv/lib/python3.5/site-packages/pycirkuit/mainwindow.py", line 363, in on_exportButton_clicked
    dst = "{dstFile}".format(dstFile=lastWD+'/'+self.openedFilename.partition('.')[0]+".tikz")
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
Aborted

Reproduce the behaviour

Copy some macros to the text box, then click the button Process and display and finally click the button Export to TIkZ.

Should not save source document automatically in certain situations

At present pycirkuit automatically saves the modified source document when user asks to process it. This behaviour could lead potentially to loss of data/functionality: perhaps user has done some modification that will not compile correctly, and he will end up with a corrupted version of his source file, or perhaps he inadvertently erases some bunch of code and autosave makes this unintended change permanent.

So,

  • Saving has to be done only when requested.
  • If user tries to do something that would lead to loss of data (quitting with unsaved changes), program has to ask user whether to save or discard these changes.
  • Perhaps the exact behaviour should be specified by means of a config option.

[BUG] Configuration dialog must let user close it even if the path to Circuit Macros is invalid.

Describe the bug
If user opens the configuration dialog and the path to Circuit Macros is not valid (because, for instance, the macros have not been downloaded yet), user cannot close the dialog using the "close" button (but still can pressing ESC)

To Reproduce
Steps to reproduce the behavior:

  1. Delete the configuration file and the Circuit Macros from disk
  2. Run the application
  3. Open the configuration dialog using the menu option "Settings"
  4. The "Circuit Macros Location" text edit box will be highlighted in light red, indicating the path isn't a valid/existing one
  5. Press the "Close" button. A message appears and you cannot close the dialog until you enter a valid path for the Circuit Macros, but maybe they are not even installed!

Expected behavior
Perhaps the dialog should be able to close even if the paths are invalid. An invalid path can be dealt with elsewhere.

Pycirkuit crashes when run

System information

Debian 9.7
Python 3.5.3

Expected behaviour

The program to run.

Actual behaviour

Pycirkuit crashes with the following error:

Traceback (most recent call last):
  File "PyCirkuit/bin/pycirkuit", line 11, in <module>
    load_entry_point('pycirkuit==0.2b1', 'gui_scripts', 'pycirkuit')()
  File "/opt/pycirkuit/PyCirkuit/lib/python3.5/site-packages/pycirkuit/main.py", line 30, in main
    from pycirkuit.mainwindow import MainWindow
  File "/opt/pycirkuit/PyCirkuit/lib/python3.5/site-packages/pycirkuit/mainwindow.py", line 33, in <module>
    from pycirkuit.configdialog import ConfigDialog
  File "/opt/pycirkuit/PyCirkuit/lib/python3.5/site-packages/pycirkuit/configdialog.py", line 38, in <module>
    from exceptions import PyCirkuitError
ImportError: No module named 'exceptions'

Reproduce the behaviour

Just install the last version and try to run it.

PyCirkuit CLI fails in an environment with no display

Describe the bug
Trying to run PyCirkuit CLI in an environment with no display fails with the following error:

pycirkuit --help
qt.qpa.screen: QXcbConnection: Could not connect to display 
Could not connect to any X display.

To Reproduce
Steps to reproduce the behavior:

  1. Open a terminal.
  2. Run pycirkuit --version
  3. See error

Expected behavior
A message with the version should be displayed.

Desktop:

  • OS: Debian GNU/Linux 10.0
  • Python 3.7.3
  • PyCirkuit 0.3.0
  • Installed from PyPi.
  • PyCirkuit is installed in a venv.

Additional context
I'm opening a PR with a proposed solution.

Different CLI/GUI behavior when circuit Macros are not found

Describe the bug
When Circuit Macros are not found in CLI mode, only a simple message is displayed. On the other side, when in GUI mode, user is asked whether the program should try to download and install them automatically.

To Reproduce
Steps to reproduce the behavior:

  1. Erase the circuit macros from your system
  2. Try to do some CLI conversion usung pycirkuit
  3. Error message is displayed.
  4. Do the same in GUI mode (invoking pycirkuit with no parameters). Try to process a file. See the difference.

Expected behavior
Same behavior in both interfaces or, at least, give user clear guidelines on how to proceed when this error happens in CLI mode.

Desktop (please complete the following information):

  • OS: [e.g. Debian GNU/Linux v10.0]
  • Python version [e.g. 3.7]
  • PyCirkuit version [e.g. 0.4.0]
  • How did you obtain PyCirkuit? GitHub repo.
  • Did you install PyCirkuit in a Python Virtual Environment as described in the README file? YES

LaTeX Templates not copied at installation

Latex templates, necessary to process source file, are not copied from their location in source code to the destination directory when doing a pip install ...

The code should search for templates also in this directory

[BUG] Weird link behavior in "About" dialog box

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Run the application
  2. Click on "Help -> About PyCirkuit" menu item
  3. Clicking on any link at the "Version" tab does nothing. Doing the same at other tabs makes text disappear!

Expected behavior
Clicking on a link should open that link in a browser window

Desktop (please complete the following information):

  • OS: Ubuntu 18.04 LTS
  • Python version: 3.6.7
  • PyCirkuit version [e.g. 0.2.0-beta2], obtained from PyPI
  • Did you install PyCirkuit in a Python Virtual Environment as described in the README file? YES

Provide a progress bar while downloading the Circuit Macros

Sometimes this operation takes a while, and the user doesn't know how much. We should:

  1. Fetch the total size of the circuit macros gzip file
  2. install a temporary progress bar with the former size as full scale.
  3. Start downloading (perhaps in an other thread) and update the percentage regularly.

[BUG] PyCirkuit ignores extension in the permission denied save box

Describe the bug
PyCirkuit ignores extension in the permission denied save box.

To Reproduce
Steps to reproduce the behavior:

  1. Open PyCirkuit.
  2. Go to "File/Open...".
  3. Open a file in a protected directory.
  4. Click on "Export".
  5. A save box will appear asking for a file name and a file type.
  6. See how the file type field is ignored.

Expected behavior
Only the set format should be saved, but it tries to save all the formats in settings ignoring the file type. It will also open a dialog box for every format in settings ignoring the previous dialog.

Desktop (please complete the following information):

  • OS: Debian Testing/Bullseye
  • Python 3.7.5
  • PyCirkuit 0.5.0-2 (Debian package)

Some keywords are not syntax-colored

Describe the bug
PyCikuit's syntax formatter doesn't recognize some Circuit Macros keywords like "series_", "parallel_" "setdir_" and "Sep"

To Reproduce
Write these keywords inside the editor. They're not colored.

Expected behavior
Circuit Macros should be colored in bold green. "Sep" is a macro parameter, perhaps should be colored in another way, or not colored at all.

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.