Skip to content

Commit

Permalink
Created Application
Browse files Browse the repository at this point in the history
  • Loading branch information
RandyParedis committed Dec 20, 2019
1 parent 0c430aa commit 9940cf7
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 112 deletions.
88 changes: 8 additions & 80 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,90 +3,18 @@
When contributing to this repository, please first discuss the change you wish to make via issue,
email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.
Please note we have a [code of conduct](CODE_OF_CONDUCT.md), please follow it in all your
interactions with the project.

## Pull Request Process

1. Ensure any install or build dependencies are removed before the end of the layer when doing a
1. Make sure you have created tests for your new feature (if possible). Also run all existing tests
to prevent breaking changes.
2. Ensure any install or build dependencies are removed before the end of the layer when doing a
build.
2. Update the README.md with details of changes to the interface, this includes new environment
3. Update the README.md with details of changes to the interface, this includes new environment
variables, exposed ports, useful file locations and container parameters.
3. Increase the version numbers in any examples files and the README.md to the new version that this
4. Increase the version numbers in any examples files and the README.md to the new version that this
Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
5. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
do not have permission to do that, you may request the second reviewer to merge it for you.

## Code of Conduct

### Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

### Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

### Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

### Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

### Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

### Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
84 changes: 64 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,49 @@ The idea behind this piece of software sprung from the necessity of creating a
lot of images of finite state automata. In the past, you needed to have a
texteditor, Graphviz-viewer and a terminal open at all times. Not anymore!

`GraphDonkey`, originally called `DotGaper`, solves this issue by combining these
applications into one.
`GraphDonkey`, originally called `DotGaper`, solves this issue by combining
these applications into one.

**Current Version:** `0.1.0`<br/>
**Build Type:** `beta` (_unstable_)<br/>
**Current Version:** `0.1.1`<br/>
**Build Type:** `beta`<br/>
**Executable OS:** Only `Linux` at this point in time
(maybe Mac as well, but cannot confirm)<br/>
**Author:** Randy Paredis

### Requirements
### Installation and Execution
There are two ways to use `GraphDonkey`. The first is via downloading the
executable and the second is via using it as a repository. There are pros and
cons to each method, so I suggest you read the following sections carefully.

#### Downloading the executable
If you know nothing about programming, or don't want to install any additional
packages, it is best you download the executable (either from zip, or tarball).
Inside, you can find a `GraphDonkey` directory that contains a lot of files.
Somewhere in there, there is a `GraphDonkey` executable that launches the
application (either from the commandline, or from a file browser).

_**Note:** At this current point in time, this method is only available for
Linux users. Potentially, it can also be executed on a Mac, but I cannot
confirm this statement. It will, however, **not** work on a Windows-system at
this point in time. If this doesn't work, or if you have created your own
distribution, please let me know._

#### Using the repository
If you cannot use the executable (for one reason or another), or if you prefer
having more flexibility over the code, or if you want to contribute (see
[this page](CONTRIBUTING.md)), you can always clone this repository. From there,
all you have to do is install the requirements (see below) and run `__main__.py`
with python 3 (this may be done in a virtual environment).

_**Note:** Only do this if you know what you're doing. I'm not responsible for
any misconfiguration of your system._

##### Requirements
_See also `requirements.txt`._
* `PyQt5` (including `uic`)
* `PyQt5`
* `graphviz`

For testing:
* `pytest`
* `lark-parser`
* `pytest` (for testing purposes only)

### Installation
Installing `GraphDonkey` is quite easy. All you have to do is clone this
Expand All @@ -34,22 +63,38 @@ modules for `pip3`, which will allow this application to work.
_For future work, the goal is to make this available as an application on
either PyPI or as a bundled resource._

### Running `GraphDonkey`
When you've installed `GraphDonkey` as described above, you can just run
the `__main__.py` file or the root folder with `Python 3`.
### Known Bugs
Often, bugs can be annoying and frustrating, therefore it is good to inform the
developers of issues you run into. It's better to ask once to many than not ask
at all (this is a general lifeline).

For `GraphDonkey`, some bugs are common and known by me, which I've listed
below. These are on the top of the list to be fixed in a future version.

* Saving a file and reopening it can cause its contents to change and comments
to disappear.
* Copying and cutting text from the editor before closing it clears the
clipboard.
* Syntax highlighting may do some weird things.
* RMB menu in the editor is not linked to other functionality.

Did you run into another error or a bug?
[Please let me know!](https://github.com/RandyParedis/GraphDonkey/issues)

### Copyright
It's important to list your sources if you're working on a project. One does not
have to reinvent the wheel, but rather list the blueprint that was used in
creating it.
* Icons for the GUI were made by [GlyphLab](https://glyphlab.com/).
(https://www.iconfinder.com/iconsets/common-toolbar)
* The `GraphDonkey` icon itself was custom-made by me. If you want to use it
elsewhere, you **must** reference this project.

### Changelog
* [0.1.2] Added tooltip for syntax error on hover
* [0.1.1] Added different ui styles (_beta_)
* [0.1.1] Created first actual release
* [0.1.1] Removed Auto-Updater
* [0.1.1] Added tooltip for syntax error on hover
* [0.1.1] Added different ui styles
* Burning Berta
* Dark Doris
* Fierce Fiona
Expand Down Expand Up @@ -91,17 +136,16 @@ https://github.com/RandyParedis/GraphDonkey/issues)
* [0.1.3] Additional configuration possibilities for graphviz
* [0.1.3] Allow for multiple files via tabbed pane?
* [0.1.3] Open parse tree of dotfile as dotfile?
* [0.2.0] Interactive view of DOT files
* [1.0.0] Interactive view of DOT files
* Similar to XDot
* Onclick of node: edit features
* Quick connections
* Should make Editor only useful for advanced features
* [0.2.1] Add all different node and edge types in interactive mode
* [0.2.1] Add Python scripting engine for live-showing of graph updates
* [1.0.1] Add all different node and edge types in interactive mode
* [1.1.0] Add Python scripting engine for live-showing of graph updates
* This will allow container algorithms to be checked visually
* Defaultly via 'open'?
* Toggling of modes
* How? Run python script and use all captured output as input for graphviz.
* [0.2.1] Multiple Languages
* [0.2.1] Use PyInstaller to turn this into a packaged app
* [0.2.1] Automatic install of updates via app
* [1.1.1] Multiple Languages
* [1.1.2] Automatic install of updates via app
2 changes: 1 addition & 1 deletion main/extra/Constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from main.extra.IOHandler import IOHandler

APP_NAME = "GraphDonkey"
APP_VERSION = "0.1.0"
APP_VERSION = "0.1.1"
APP_ICON = QIcon(IOHandler.dir_icons("graphdonkey.svg"))

ICON_GRAPHVIZ = QImage(IOHandler.dir_icons("graphviz.png"))
Expand Down
8 changes: 4 additions & 4 deletions main/extra/IOHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ def dir_main():
def dir_root(*paths):
return os.path.realpath(IOHandler.join(IOHandler.dir_main(), "..", *paths))

@staticmethod
def dir_ui(*paths):
return os.path.realpath(IOHandler.join(IOHandler.dir_root(), "ui", *paths))

@staticmethod
def dir_vendor(*path):
return os.path.realpath(IOHandler.join(IOHandler.dir_root(), "vendor", *path))

@staticmethod
def dir_ui(*paths):
return os.path.realpath(IOHandler.join(IOHandler.dir_vendor(), "ui", *paths))

@staticmethod
def dir_styles(*styles):
return os.path.realpath(IOHandler.join(IOHandler.dir_vendor(), "styles", *styles))
Expand Down
2 changes: 1 addition & 1 deletion main/extra/Parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class Parser:
def __init__(self):
self.grammar = ""
with open(IOHandler.dir_vendor("graphviz.g"), "r") as file:
with open(IOHandler.dir_vendor("graphviz.lark"), "r") as file:
self.grammar = file.read()
self.parser = Lark(self.grammar)

Expand Down
5 changes: 3 additions & 2 deletions text.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
https://graphviz.readthedocs.io/en/stable/manual.html#using-raw-dot
https://stackoverflow.com/questions/14885481/how-to-highlight-a-string-of-text-within-a-qtextedit

pyinstaller __main__.py -n GraphDonkey --add-data ./vendor/:vendor/ -y

TODO: - Save File => Save as text (gv, canvas, dot...)
Allow saving file with errors/comments
- Add Export Function (actually strips comments and crashes on errors)
- Remove Auto-Updater (for now)
- Bugfix: Copy not working iff file was closed
- Bugfix: Copy/Cut not working iff file was closed
i.e.: Closing a file seems to clear the clipboard
- Syntax Highlighting does not work 100% as intended

Expand Down
3 changes: 1 addition & 2 deletions vendor/graphviz.g → vendor/graphviz.lark
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
COMMENT_PRE: /^#[^\n]*/
COMMENT_SNG: "//" /[^\n]/*
COMMENT_MLT: /\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//
WS: /[ \t\f\r\n]/+

%ignore WS
%ignore COMMENT_PRE
Expand Down Expand Up @@ -45,5 +46,3 @@ NUMERAL: /[-]?(.[0-9]+|[0-9]+(.[0-9]*)?)/
STRING: "\"" /[^\"\\]*(?:\\.[^\"\\]*)*/ "\""
HTML: /<.*?>/
id: NAME | NUMERAL | STRING | HTML

%import common.WS
2 changes: 0 additions & 2 deletions ui/MainWindow.ui → vendor/ui/MainWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@
<property name="title">
<string>&amp;Help</string>
</property>
<addaction name="action_CheckUpdates"/>
<addaction name="separator"/>
<addaction name="action_AboutGraphDonkey"/>
<addaction name="action_AboutGraphviz"/>
<addaction name="action_AboutQt"/>
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 9940cf7

Please sign in to comment.