Giter Club home page Giter Club logo

guiguts-py's People

Contributors

cpeel avatar jandacpp avatar tangledhelix avatar windymilla avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

guiguts-py's Issues

GG2 needs a license

For developers to have confidence contributing to this repo it should have a license. Which license is up to @windymilla as the primary author and as the only other contributor thus far I hereby retroactively accept whatever open-source license he uses.

I am not a lawyer, nor do I play one on TV or the internet, but if we intend to lift code from GG1 we are probably incentivized to make GG2 use the same license. That said, if we intend to bundle other code in a GG2 distribution that code will need to be using a compatible license. If we merely use other code (for instance, if we use ebookmaker as a python dependency but we do not bundle the ebookmaker code with GG2) we do not need to have compatible licenses as we are not redistributing the code. I think. To reiterate: I am not a lawyer.

Possibly-useful information:

Improve/test/fix image viewer

Image viewer is very rudimentary, allowing pan/zoom by mouse only (drag, Control+mouse wheel, maybe scroll gestures on mousepads)

Also hasn't been tested on different platforms.

At minimum it needs

  • Zoom buttons: in & out, fit to page width/height or similar

Also consider what zoom/position to use when new image is loaded, which could be different size/aspect ratio.
Also what to do if floating window is resized.

Problem with opening new text file to replace old one

I'm not sure I grok this in its completeness, so I'll describe what happens for me as far as I've been able to test it (macOS, and no idea whether Windows has the same issue).

I discovered it when I was tangling with the cursor-not-active issue.

With a clean instance of gg2, open a text file. Try to figure out how to get the cursor moving and load images, and decide that maybe reloading the file will fix it. Img: is not set (i.e. still has a hyphen instead of a number). The test file I was using had 27 pages.

When I reloaded the test file, the Img number went to 27. When clicking into the text, the cursor moves. An image can be loaded, but it's the last image. The img in the status bar remained at 27. Even if I opened a text file that had more pages, it appears to be stuck there for that document for that session.

Begin Word Frequency tool

Some checks in GG1's WF tool are probably not used since duplicates of other checks, e.g. comma followed by upper case.
Some are not to do with word list, e.g. Character Counts
Unicode>FF probably no longer required

Dashes, hyphens, italic/bold/etc, Mixed case, accents, ligatures, regexp are probably useful - maybe others like 1st Harmonic

Reorganize mainwindow/widgets code

Generic widgets (formerly dialogs) code needs to know about maintext in order to bind keystrokes.
Mainwindow code needs to use generic widgets, e.g. for MessageLogDialog.

Consider putting widgets into mainwindow, or splitting things up in mainwindow, or storing key widgets in a separate low-level module, or something else :(

Add case-change features

As in GG1's edit menu:

  • lowercase selection
  • UPPERCASE selection
  • Sentence case selection
  • Title Case selection

Font management

Choose a default font (for each platform Win/Mac/Linux):

  • should ship with the platform by default
  • should be monospace / fixed-width

I would also propose bundling DP Sans Mono for easy use, if possible. I'm not sure how to install custom fonts on every platform, but on macOS I think adding font files to $HOME/Library/Fonts/ is sufficient.

"Linux" is actually a bunch of different platforms, really... I'll leave it for someone else to figure out what default fonts are available on any of them, since I have no clue about it...

Per-platform key bindings

Something that bothers me in Guiguts is the use of Windows-style keymaps even when run on Macs. Probably 99% of the difference between the platforms would be swapping Ctrl for Cmd. In other words, like this example:

Function Windows Linux Mac
Find Ctrl-F Ctrl-F Cmd-F
Save Ctrl-S Ctrl-S Cmd-S

In most Mac apps, you can use Emacs-style movement keys in text areas / text input boxes. Many Mac users are accustomed to doing so. In the current incarnation of guiguts-py, this works (because no other maps are overriding it, yet). If Cmd bindings are used for the application commands / menus, then this should continue to work and it would be an improvement over the prior generation (for Mac users, at least).

Even for users who don't use these keys, using Cmd bindings would be more in line with the other apps on the system and it would be much more natural on the platform.

When I use Guiguts, I often hit one of these keys out of habit and trigger a command unintentionally.

For those not familar, Emacs-style mappings possibly relevant to this issue are below. I didn't check which of these overlap with Guiguts - at least several of them do, they may not all overlap.

  • Ctrl-F Ctrl-B move cursor right (forward) or left (backward)
  • Ctrl-P Ctrl-N move cursor to previous / next line (up, down)
  • Ctrl-A Ctrl-E move cursor to beginning / end of current line
  • Ctrl-D Ctrl-H delete character to right / left of cursor
  • Ctrl-K delete from cursor to end of line
  • Ctrl-O split line into two lines, at current cursor position
  • Ctrl-T transpose characters on either side of cursor
  • Ctrl-V page down

Rewrap features

Algorithm should match GG1 pretty closely as it's been tailored for our needs.

Prompt to set image (pngs) directory

Currently, the directory that contains the page images must be in the same location as the text file. It's useful to be able to leave the images where they are, and point to where the directory is, instead of having to move them. Not critical, but nice to have.

Evaluate upgrading python version to 3.12

GG2 is currently being developed against python 3.10 per the README.md and it is currently supported for security releases. ๐Ÿ‘. However, binaries aren't available for the most recent 3.10 release on Windows. python 3.12 is the most recent supported version -- see the python version status.

We should consider updating the minimum version to 3.12 so we're developing against the latest version. Windows and macOS (via Homebrew) have ready access to python 3.12.

The biggest downside and thing to consider is for Linux users. Some very common, supported platforms include older versions:

  • Ubuntu 20 (in support through mid 2024) uses python 3.8
  • Ubuntu 22 uses python 3.10

Getting newer versions installed on those platforms is doable but often not trivial. We should consult with some of our GG1 Linux users and get their thoughts on python version and either proceed with this work or WONTFIX this issue and punt it to the future.

I don't see us targeting new python features that would preclude users from running on older versions, but for support purposes by having a target version we test and validate against is useful -- and that may be sticking with 3.10.

Unmatched markup checks

In GG1 tools menu are checks for:

  • DP Tag
  • Brackets
  • Block Markup

Could be tackled one at a time or all three

Add automatic sphinx check

See if it's possible to run sphinx and detect docstring errors using Github actions
See python-app.yml

Add the ability to close active doc and open new one

Current options are Open and Quit. Close should close the current document without quitting the application (prompting for save if there are changes since the last save) and open a new blank document, or leave it with no window, but allow the user to open a new document.

Add Search feature

Possibly include some/all of options available in GG1:
Case / regex / reverse / whole word

Try to mimic behavior of more modern editor(s) - consider things like if text is selected before beginning search

Add line numbers

Line numbers are very useful in a text editor. Users should be able to turn them on and off.

Allow only one instance of dialogs requiring user input

Currently, if a user opens a "Save as ..." or "Open ..." dialog, gets distracted and when they return don't notice that the dialog is already open, an try to open a new one, a new one opens quite nicely! It works properly, in that once the input is done, and the action takes place, all of the open dialogs are closed, but it's probably still not a good idea to have multiple windows open at the same time. Screenshot:
image

This is on macOS Monterey, 12.7.2.

Add a ruler

A relatively recent addition to perl GG, the ruler is a nice-to-have feature, though not critical. Users should be able to turn it on or off.

Auto Img can cause loop

If Auto Img is trying to load an image but can't find it, it pops a directory selection dialog. If the users cancels this, it just pops again.
One solution would be turn off Auto Img if user cancels dir selection.
Another would be not to pop the dir selection at all if because of Auto Img, but that would require the user to manually select the folder.

Spell checker

Base on Spell Query - not Aspell-based Spell Check

Research: determine which regular expression engine to use

Python's base regex engine (in the re module) is "similar" to Perl PCRE but not exactly compatible. This leaves us with a choice to make, and some research to do, to inform the choice: should we make GG2 backward-compatible with PP'er workflows? Many PP'ers have carefully honed regexes used in their workflows. An argument could be made that the best choice is to make GG2 perfectly compatible with those workflows. But that must be counterbalanced against the amount of effort required to accomplish the backward compatibility, and ongoing maint, etc.

References / projects to review:

At a cursory glance, the python-pcre option seems "best" in terms of least disruptive to users, but I have no opinion yet about the future maintainability about any of these options. I will look at this, though of course I would welcome any opinions or input from anyone who has time to read / think about this.

Make document window live on file open

If you just start up a gg2 instance and start typing, this problem doesn't appear to exist, but currently (confirmed at least on Mac and Windows), when a new document is first opened in gg2 (i.e. a new project's text CTF), the cursor is visible, but not active. This means that

  • you can't move the cursor with the arrow keys
  • you can't load images

To make the window active, you need to click in the GG window, or, on a Mac, cmd-tab away from and back into the python instance that is running (@windymilla, can you describe the Windows method?).

Basic Fixup tool

In Tools menu in GG1

May be worth checking in forums - some of the tool's options in GG1 are dangerous and maybe not used

Add Replace to Search

After #37

Advanced features (could be postponed to future issue):

  • Multi replace boxes, similar to GG1
  • Ability to execute arbitrary Python code (\C...\E in GG1 executes Perl code)

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.