Compare commits
70 commits
Author | SHA1 | Date | |
---|---|---|---|
75a504b1f4 | |||
644f0f1ba8 | |||
d51ea4baed | |||
7a0c5262e2 | |||
1fcbeb108c | |||
cfd846287b | |||
dad77b30af | |||
5a372963a2 | |||
e681ce1542 | |||
247920c234 | |||
06dad0330c | |||
deea8a1bd6 | |||
dcd6df2382 | |||
dacbfd3bb0 | |||
32f51811c5 | |||
337ef45e17 | |||
381c763a3c | |||
a194a1fda2 | |||
496233dcc5 | |||
0059ac99a8 | |||
e4b7a88a60 | |||
336df07b38 | |||
7b63dac8e2 | |||
11821b40ab | |||
ce240ef672 | |||
ec0570fd73 | |||
a9b5c1b797 | |||
d02b81c309 | |||
d41bccb184 | |||
2094d8da73 | |||
4ab01b84e3 | |||
bb856143fa | |||
8bb8e9b238 | |||
d0b16c7ff9 | |||
9aca1b1e06 | |||
3cd1e3418f | |||
3b5b2b9e21 | |||
39a9c20bf1 | |||
da799996ed | |||
cdfa79bccb | |||
4e85024b40 | |||
e13307ca5f | |||
d6cd6ebc3d | |||
49f828ccf0 | |||
f15a14d470 | |||
147ebccfd8 | |||
ac5f5aad23 | |||
286dac970e | |||
564821d707 | |||
162388a1a9 | |||
1f0eb0e79d | |||
00be7e6206 | |||
27f248292e | |||
b499977e44 | |||
39f1c41a60 | |||
2f8ab31ef5 | |||
12c1b69037 | |||
074a7287a1 | |||
6832d425e9 | |||
5671b9bf06 | |||
8d48ff43a9 | |||
5a0aed251b | |||
0b1003b95d | |||
a67db6c024 | |||
63ccda61aa | |||
bf77881cbe | |||
3e9950c3ca | |||
c9a6f9120b | |||
948f7ffa94 | |||
4233c29d58 |
5 changed files with 113 additions and 15 deletions
|
@ -1,22 +1,61 @@
|
|||
name: Sanity check
|
||||
name: Test
|
||||
|
||||
on:
|
||||
push:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Test Python file
|
||||
runs-on: debian-latest
|
||||
|
||||
syntax:
|
||||
name: Check syntax
|
||||
runs-on: alpine
|
||||
steps:
|
||||
- uses: https://git.swee.codes/swee/setup-alpine@main
|
||||
with:
|
||||
additional: python3 libxml2-utils ruff
|
||||
- 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
|
||||
- name: Lint python files
|
||||
run: ruff check
|
||||
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: forgejo/upload-artifact@v4
|
||||
with:
|
||||
path: screenshot.png
|
||||
apt:
|
||||
name: Build Debian Package
|
||||
runs-on: docker
|
||||
needs: syntax
|
||||
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: |
|
||||
python generate-deb.py
|
||||
- uses: actions/upload-artifact@v3
|
||||
python3 generate-deb.py
|
||||
- name: Upload package for testing
|
||||
uses: forgejo/upload-artifact@v4
|
||||
with:
|
||||
path: sweecrypt-gtk.deb
|
22
.forgejo/workflows/publish.yml
Normal file
22
.forgejo/workflows/publish.yml
Normal file
|
@ -0,0 +1,22 @@
|
|||
name: Create release package
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
apt:
|
||||
name: Build Debian Package
|
||||
runs-on: docker
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- name: Generate DEB
|
||||
run: |
|
||||
python3 generate-deb.py
|
||||
- name: Upload package
|
||||
run: |
|
||||
curl --user swee:$SECRET --upload-file sweecrypt-gtk.deb https://git.swee.codes/api/packages/SweeZero/debian/pool/stable/main/upload
|
||||
env:
|
||||
SECRET: ${{ secrets.TOKEN }}
|
|
@ -1,5 +1,5 @@
|
|||
Package: sweecrypt-gtk
|
||||
Version: 1.1
|
||||
Version: 1.2
|
||||
Section: utils
|
||||
Priority: optional
|
||||
Architecture: all
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
import gi, os, sys, sweecrypt as sc
|
||||
import gi
|
||||
import os
|
||||
import sys
|
||||
import sweecrypt as sc
|
||||
from gi.repository import Gtk
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, GdkPixbuf, Gdk
|
||||
UI_FILE = os.path.dirname(os.path.realpath(__file__)) + "/sweecrypt-gtk.ui"
|
||||
class GUI:
|
||||
def __init__(self):
|
||||
|
@ -14,15 +17,15 @@ 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))
|
||||
self.builder.get_object('text').set_property("text", sc.encrypt(inputted, shift))
|
||||
self.builder.get_object('encode').set_property("active", False)
|
||||
else:
|
||||
self.builder.get_object('text').set_property("text", sc.decrypt(inputted))
|
||||
self.builder.get_object('text').set_property("text", sc.decrypt(inputted, shift))
|
||||
self.builder.get_object('encode').set_property("active", True)
|
||||
def main():
|
||||
app = GUI()
|
||||
Gtk.main()
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
|
|
|
@ -2,6 +2,12 @@
|
|||
<!-- 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>
|
||||
|
@ -51,6 +57,18 @@ 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>
|
||||
|
@ -72,6 +90,22 @@ 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