Compare commits
No commits in common. "main" and "v1.1" have entirely different histories.
4 changed files with 11 additions and 82 deletions
|
@ -1,58 +1,22 @@
|
|||
name: Test
|
||||
name: Sanity check
|
||||
|
||||
on:
|
||||
push:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
syntax:
|
||||
name: Check syntax
|
||||
runs-on: alpine
|
||||
steps:
|
||||
- uses: https://git.swee.codes/swee/setup-alpine@main
|
||||
with:
|
||||
additional: python3 libxml2-utils
|
||||
- uses: actions/checkout@v4
|
||||
- name: Check syntax of Python file
|
||||
run: python3 -m py_compile sweecrypt-gtk.py
|
||||
- name: Check syntax of XML file
|
||||
run: xmllint --format sweecrypt-gtk.ui
|
||||
x11:
|
||||
name: Test the application
|
||||
runs-on: alpine
|
||||
needs: syntax
|
||||
steps:
|
||||
- uses: https://git.swee.codes/swee/setup-alpine@main
|
||||
with:
|
||||
additional: tigervnc py3-gobject3 py3-xdg py3-pip gtk+3.0 apk-gtk3 openbox scrot font-noto-all
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install dependencies
|
||||
run: pip install --break-system-packages sweecrypt
|
||||
- name: Set VNC password
|
||||
run: echo -e "sweecrypt\nsweecrypt\n" | vncpasswd
|
||||
- name: Start an X11 server
|
||||
run: USER=root vncserver :5 &
|
||||
- name: Start the app
|
||||
run: DISPLAY=:5 python3 sweecrypt-gtk.py &
|
||||
- name: Wait 5 secs
|
||||
run: sleep 5
|
||||
- name: Take a screenshot
|
||||
run: DISPLAY=:5 scrot screenshot.png
|
||||
- name: Upload screenshot
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: screenshot.png
|
||||
apt:
|
||||
name: Build Debian Package
|
||||
runs-on: docker
|
||||
needs: syntax
|
||||
build:
|
||||
name: Test Python file
|
||||
runs-on: debian-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- name: Install dependencies
|
||||
run: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||
- name: Generate DEB
|
||||
run: |
|
||||
python3 generate-deb.py
|
||||
python generate-deb.py
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: sweecrypt-gtk.deb
|
|
@ -1,5 +1,5 @@
|
|||
Package: sweecrypt-gtk
|
||||
Version: 1.2
|
||||
Version: 1.1
|
||||
Section: utils
|
||||
Priority: optional
|
||||
Architecture: all
|
||||
|
|
|
@ -14,13 +14,12 @@ class GUI:
|
|||
checkbox.set_property("label", "Encode" if checkbox.get_property("active") else "Decode")
|
||||
def start_clicked(self, start):
|
||||
encode = self.builder.get_object('encode').get_property("active")
|
||||
shift = int(self.builder.get_object('shift').get_property("value"))
|
||||
inputted = self.builder.get_object('text').get_property("text")
|
||||
if encode:
|
||||
self.builder.get_object('text').set_property("text", sc.encrypt(inputted, shift))
|
||||
self.builder.get_object('text').set_property("text", sc.encrypt(inputted))
|
||||
self.builder.get_object('encode').set_property("active", False)
|
||||
else:
|
||||
self.builder.get_object('text').set_property("text", sc.decrypt(inputted, shift))
|
||||
self.builder.get_object('text').set_property("text", sc.decrypt(inputted))
|
||||
self.builder.get_object('encode').set_property("active", True)
|
||||
def main():
|
||||
app = GUI()
|
||||
|
|
|
@ -2,12 +2,6 @@
|
|||
<!-- Generated with glade 3.40.0 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.24"/>
|
||||
<object class="GtkAdjustment" id="database-shift">
|
||||
<property name="lower">-100</property>
|
||||
<property name="upper">100</property>
|
||||
<property name="step-increment">1</property>
|
||||
<property name="page-increment">10</property>
|
||||
</object>
|
||||
<object class="GtkTextBuffer" id="text">
|
||||
<property name="text" translatable="yes">replace this text with anything
|
||||
you want to encode or decode.</property>
|
||||
|
@ -57,18 +51,6 @@ you want to encode or decode.</property>
|
|||
<property name="active">True</property>
|
||||
<signal name="toggled" handler="toggle" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Database shift: </property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
|
@ -90,22 +72,6 @@ you want to encode or decode.</property>
|
|||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="shift">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="caps-lock-warning">False</property>
|
||||
<property name="primary-icon-tooltip-text" translatable="yes">Database shift</property>
|
||||
<property name="adjustment">database-shift</property>
|
||||
<property name="climb-rate">1</property>
|
||||
<property name="numeric">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
|
Loading…
Add table
Reference in a new issue