Skip to content

Commit

Permalink
Merge pull request #47 from SenlisO/dev
Browse files Browse the repository at this point in the history
Remove duplicate code, use `common` lib
  • Loading branch information
Batcastle authored Oct 29, 2021
2 parents 25089ff + 8f44ecd commit e4be2d1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
7 changes: 7 additions & 0 deletions development.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ The following packages are required in order to do development for `system-insta
* `python3`
* `gir1.2-gtk-3.0`
* `p7zip-full`
* `python3-parted`
* `python3-gnupg`

The following are not required but may help out
* `arch-install-scripts`
* `coreutils`
* `squashfs-tools`
* `pylint`

To install all of the dependencies at once, use
```bash
sudo apt install -y python3 gir1.2-gtk-3.0 p7zip-full python3-parted python3-gnupg arch-install-scripts coreutils squashfs-tools pylint
```

You can find a number of tests to make sure your programs work correctly in the `tests` directory. These are currently tailored to how these programs are written, i.e. they work Python scripts. None of the UI is tested yet. Feel free to write more tests and request their addition in a pull request.

All Python code should conform to `PEP8` as closely as possible. If you open a pull request `pep8speaks` will provide feedback on your `PEP8` conformance.
Expand Down
3 changes: 1 addition & 2 deletions roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@
## main.py
| Function Name | Pylint | Unit/Doc Tests | Type Hinting |
| --- | --- | --- | --- |
| eprint | | | |
| has_special_character | | | |
| Main.init | | | |
| Main.set_default_margins | | | |
Expand Down Expand Up @@ -441,4 +440,4 @@
| unique | | | |
| show_success | | | |
| reboot | | | |
| poweroff | | | |
| poweroff | | | |
9 changes: 2 additions & 7 deletions usr/share/system-installer/UI/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,13 @@
import re
import json
import os
import common
from subprocess import Popen, check_output, DEVNULL
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
import auto_partitioner


def eprint(*args, **kwargs):
"""Make it easier for us to print to stderr"""
print(*args, file=sys.stderr, **kwargs)


def has_special_character(input_string):
"""Check for special characters"""
regex = re.compile(r'[@_!#$%^&*()<>?/\|}{~:]')
Expand Down Expand Up @@ -221,7 +216,7 @@ def oem_startup(self, widget):

def select_config(self, widget):
"""Quick Install File Selection Window"""
eprint("\t###\tQUICK INSTALL MODE ACTIVATED\t###\t")
common.eprint("\t###\tQUICK INSTALL MODE ACTIVATED\t###\t")
dialog = Gtk.FileChooserDialog("System Installer", self,
Gtk.FileChooserAction.OPEN,
(Gtk.STOCK_CANCEL,
Expand Down

0 comments on commit e4be2d1

Please sign in to comment.