Commit 00b20f91 authored by Danial Behzadi's avatar Danial Behzadi
Browse files

modulize for pypi

parent 290a997c
Pipeline #430006 passed with stages
in 1 minute and 7 seconds
image: python:latest
# Change pip's cache directory to be inside the project directory since we can
# only cache local items.
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
# Pip's cache doesn't store the python packages
# https://pip.pypa.io/en/stable/reference/pip_install/#caching
#
# If you want to also cache the installed packages, you have to install
# them in a virtualenv and cache it as well.
cache:
paths:
- .cache/pip
- venv/
before_script:
- python -V # Print out python version for debugging
- pip install virtualenv
- virtualenv venv
- source venv/bin/activate
- pip install --upgrade pip
build:
stage: build
script:
- pip install --upgrade setuptools wheel
- python setup.py sdist bdist_wheel
artifacts:
paths:
- dist
deploy:
stage: deploy
script:
- pip install --upgrade twine
- python -m twine upload --non-interactive --disable-progress-bar --skip-existing dist/*
artifacts:
paths:
- dist
only:
- master
recursive-include carburetor/desktop *
recursive-include carburetor/locales *
recursive-include carburetor/ui *
......@@ -25,8 +25,6 @@ gettext.textdomain('messages')
_ = gettext.gettext
COMMAND = "tractor "
app_name = _("Carburetor")
app_comment = _("Settings for Tractor")
VERSION = "3.5"
GLib.set_application_name(app_name)
Notify.init(app_name)
......
......@@ -134,8 +134,6 @@ class Handler:
chooser.connect("file-set", on_file_set)
def on_AboutDialog_realize(self, dialog):
dialog.set_program_name(config.app_name)
dialog.set_version(config.VERSION)
dialog.set_translator_credits(config._("translator-credits"))
def on_AboutDialog_destroy(self, dialog):
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-12-23 05:31+0330\n"
"POT-Creation-Date: 2021-06-28 04:07+0430\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -17,266 +17,270 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: carburetor/actions.py:66
#: carburetor/actions.py:92
msgid "Disconnecting…"
msgstr ""
#: carburetor/actions.py:70
#: carburetor/actions.py:96
msgid "Connecting…"
msgstr ""
#: carburetor/actions.py:81
#: carburetor/actions.py:122
msgid "You have a new identity!"
msgstr ""
#: carburetor/actions.py:83
#: carburetor/actions.py:126
msgid "Tractor is not running!"
msgstr ""
#: carburetor/config.py:20 carburetor/main.ui:177
#: carburetor/config.py:27 carburetor/ui/main.ui:215
msgid "Carburetor"
msgstr ""
#: carburetor/config.py:21 carburetor/about.ui:38 carburetor/main.ui:178
msgid "Settings for Tractor"
msgstr ""
#: carburetor/functions.py:57 carburetor/main.ui:121
#: carburetor/functions.py:77 carburetor/ui/main.ui:133
msgid "Stopped"
msgstr ""
#: carburetor/functions.py:59 carburetor/main.ui:187
#: carburetor/functions.py:79 carburetor/ui/main.ui:226
msgid "_Connect"
msgstr ""
#: carburetor/functions.py:64
#: carburetor/functions.py:91
msgid "Tractor is stopped"
msgstr ""
#: carburetor/functions.py:71
#: carburetor/functions.py:102
msgid "Running"
msgstr ""
#: carburetor/functions.py:73
#: carburetor/functions.py:104
msgid "_Disconnect"
msgstr ""
#: carburetor/functions.py:78
#: carburetor/functions.py:114
msgid "Tractor is running"
msgstr ""
#: carburetor/handler.py:28
#: carburetor/handler.py:39
msgid "Austria"
msgstr ""
#: carburetor/handler.py:29
#: carburetor/handler.py:40
msgid "Bulgaria"
msgstr ""
#: carburetor/handler.py:30
#: carburetor/handler.py:41
msgid "Canada"
msgstr ""
#: carburetor/handler.py:31
#: carburetor/handler.py:42
msgid "Czech"
msgstr ""
#: carburetor/handler.py:32
#: carburetor/handler.py:43
msgid "Finland"
msgstr ""
#: carburetor/handler.py:33
#: carburetor/handler.py:44
msgid "France"
msgstr ""
#: carburetor/handler.py:34
#: carburetor/handler.py:45
msgid "Germany"
msgstr ""
#: carburetor/handler.py:35
#: carburetor/handler.py:46
msgid "Ireland"
msgstr ""
#: carburetor/handler.py:36
#: carburetor/handler.py:47
msgid "Moldova"
msgstr ""
#: carburetor/handler.py:37
#: carburetor/handler.py:48
msgid "Netherlands"
msgstr ""
#: carburetor/handler.py:38
#: carburetor/handler.py:49
msgid "Norway"
msgstr ""
#: carburetor/handler.py:39
#: carburetor/handler.py:50
msgid "Poland"
msgstr ""
#: carburetor/handler.py:40
#: carburetor/handler.py:51
msgid "Romania"
msgstr ""
#: carburetor/handler.py:41
#: carburetor/handler.py:52
msgid "Russia"
msgstr ""
#: carburetor/handler.py:42
#: carburetor/handler.py:53
msgid "Seychelles"
msgstr ""
#: carburetor/handler.py:43
#: carburetor/handler.py:54
msgid "Singapore"
msgstr ""
#: carburetor/handler.py:44
#: carburetor/handler.py:55
msgid "Spain"
msgstr ""
#: carburetor/handler.py:45
#: carburetor/handler.py:56
msgid "Sweden"
msgstr ""
#: carburetor/handler.py:46
#: carburetor/handler.py:57
msgid "Switzerland"
msgstr ""
#: carburetor/handler.py:47
#: carburetor/handler.py:58
msgid "Ukraine"
msgstr ""
#: carburetor/handler.py:48
#: carburetor/handler.py:59
msgid "United Kingdom"
msgstr ""
#: carburetor/handler.py:49
#: carburetor/handler.py:60
msgid "United States"
msgstr ""
#: carburetor/handler.py:50
#: carburetor/handler.py:61
msgid "Auto (Best)"
msgstr ""
#: carburetor/handler.py:105
#: carburetor/handler.py:137
msgid "translator-credits"
msgstr ""
#: carburetor/about.ui:37
msgid "Copyright © 2019-2020, Tractor Team"
#: carburetor/ui/about.ui:38
msgid "Copyright © 2019-2021, Tractor Team"
msgstr ""
#: carburetor/about.ui:40
#: carburetor/ui/about.ui:39
msgid "GTK fronted for Tractor"
msgstr ""
#: carburetor/ui/about.ui:41
msgid "Source Code"
msgstr ""
#: carburetor/main.ui:40
#: carburetor/ui/main.ui:41
msgid "_New ID"
msgstr ""
#: carburetor/main.ui:49
#: carburetor/ui/main.ui:50
msgid "_Set proxy on system"
msgstr ""
#: carburetor/main.ui:57
#: carburetor/ui/main.ui:58
msgid "_Check connection"
msgstr ""
#: carburetor/main.ui:257
#: carburetor/ui/main.ui:216
msgid "For Tractor"
msgstr ""
#: carburetor/ui/main.ui:305
msgid "Preferences"
msgstr ""
#: carburetor/main.ui:272
#: carburetor/ui/main.ui:320
msgid "About Carburetor"
msgstr ""
#: carburetor/main.ui:287
#: carburetor/ui/main.ui:335
msgid "Quit"
msgstr ""
#: carburetor/preferences.ui:40
#: carburetor/ui/preferences.ui:40
msgid "General"
msgstr ""
#: carburetor/preferences.ui:45
#: carburetor/ui/preferences.ui:45
msgid "Exit Node"
msgstr ""
#: carburetor/preferences.ui:64
#: carburetor/ui/preferences.ui:64
msgid "Exit Country"
msgstr ""
#: carburetor/preferences.ui:78
#: carburetor/ui/preferences.ui:78
msgid "The country you want to connect from"
msgstr ""
#: carburetor/preferences.ui:123
#: carburetor/ui/preferences.ui:123
msgid "Accept Connections"
msgstr ""
#: carburetor/preferences.ui:137
#: carburetor/ui/preferences.ui:137
msgid "Allow external devices to use this network"
msgstr ""
#: carburetor/preferences.ui:174
#: carburetor/ui/preferences.ui:174
msgid "Ports"
msgstr ""
#: carburetor/preferences.ui:179
#: carburetor/ui/preferences.ui:179
msgid "Socks Port"
msgstr ""
#: carburetor/preferences.ui:193
#: carburetor/ui/preferences.ui:193
msgid "Local port on which Tractor would be listen"
msgstr ""
#: carburetor/preferences.ui:227
#: carburetor/ui/preferences.ui:227
msgid "DNS Port"
msgstr ""
#: carburetor/preferences.ui:241
#: carburetor/ui/preferences.ui:241
msgid "Local port on which you would have an anonymous name server"
msgstr ""
#: carburetor/preferences.ui:275
#: carburetor/ui/preferences.ui:275
msgid "HTTP Tunnel Port"
msgstr ""
#: carburetor/preferences.ui:289
#: carburetor/ui/preferences.ui:289
msgid "Local port on which a HTTP tunnel would be listen"
msgstr ""
#: carburetor/preferences.ui:326 carburetor/preferences.ui:379
#: carburetor/ui/preferences.ui:326 carburetor/ui/preferences.ui:379
msgid "Bridges"
msgstr ""
#: carburetor/preferences.ui:331
#: carburetor/ui/preferences.ui:331
msgid "Type of bridge"
msgstr ""
#: carburetor/preferences.ui:345
#: carburetor/ui/preferences.ui:345
msgid "Use obfs4proxy"
msgstr ""
#: carburetor/preferences.ui:415
#: carburetor/ui/preferences.ui:415
msgid "Save"
msgstr ""
#: carburetor/preferences.ui:419
#: carburetor/ui/preferences.ui:419
msgid "Save Bridges as a file in your local configs"
msgstr ""
#: carburetor/preferences.ui:438
#: carburetor/ui/preferences.ui:438
msgid "Client Transport Plugin"
msgstr ""
#: carburetor/preferences.ui:452
#: carburetor/ui/preferences.ui:452
msgid "Please specify the plugin executable file"
msgstr ""
#: carburetor/preferences.ui:491
#: carburetor/ui/preferences.ui:491
msgid "Can not save the bridges"
msgstr ""
#: carburetor/preferences.ui:492
#: carburetor/ui/preferences.ui:492
msgid "Please check the syntax of bridges"
msgstr ""
......@@ -20,10 +20,10 @@ def initialize_builder():
'''
connect builder to files and handlers
'''
s_data_dir = config.s_data_dir
builder.add_from_file(s_data_dir+'/about.ui')
builder.add_from_file(s_data_dir+'/main.ui')
builder.add_from_file(s_data_dir+'/preferences.ui')
ui_dir = config.s_data_dir+'/ui'
builder.add_from_file(ui_dir+'/about.ui')
builder.add_from_file(ui_dir+'/main.ui')
builder.add_from_file(ui_dir+'/preferences.ui')
builder.connect_signals(handler.Handler())
......@@ -39,7 +39,8 @@ def css():
apply css to ui
'''
css_provider = Gtk.CssProvider()
css_provider.load_from_path(config.s_data_dir+'/style.css')
ui_dir = config.s_data_dir+'/ui'
css_provider.load_from_path(ui_dir+'/style.css')
screen = Gdk.Screen.get_default()
context = Gtk.StyleContext()
context.add_provider_for_screen(
......
......@@ -34,8 +34,9 @@ Author: Danial Behzadi <dani.behzi@ubuntu.com>
<property name="icon-name">carburetor</property>
<property name="type-hint">dialog</property>
<property name="program-name">Carburetor</property>
<property name="version">3.6</property>
<property name="copyright" translatable="yes">Copyright © 2019-2021, Tractor Team</property>
<property name="comments" translatable="yes">Settings for Tractor</property>
<property name="comments" translatable="yes">GTK fronted for Tractor</property>
<property name="website">https://framagit.org/tractor/carburetor/</property>
<property name="website-label" translatable="yes">Source Code</property>
<property name="authors">Danial Behzadi &lt;dani.behzi@ubuntu.com&gt;</property>
......
......@@ -148,7 +148,7 @@ Author: Danial Behzadi <dani.behzi@ubuntu.com>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">close-symbolic</property>
<property name="icon-name">application-exit-symbolic</property>
</object>
</child>
</object>
......@@ -213,7 +213,7 @@ Author: Danial Behzadi <dani.behzi@ubuntu.com>
<property name="can-focus">False</property>
<property name="valign">start</property>
<property name="title" translatable="yes">Carburetor</property>
<property name="subtitle" translatable="yes">Settings for Tractor</property>
<property name="subtitle" translatable="yes">For Tractor</property>
<property name="show-close-button">True</property>
<property name="decoration-layout">:close</property>
<child>
......
man/carburetor.1
carburetor/desktop/carburetor.1
carburetor (3.6) hirsute; urgency=medium
* Modulize app to be placed in pypi
-- Danial Behzadi <dani.behzi@ubuntu.com> Mon, 28 Jun 2021 03:55:00 +0430
carburetor (3.5) hirsute; urgency=medium
* Add a cancel button for progress
......
......@@ -8,7 +8,7 @@ Build-Depends: debhelper (>=9), dh-python, python3-all, python3-setuptools
Package: carburetor
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}, tractor (>=3.8~), python3, python3-gi(>=3.10.2), python3-gi-cairo, gir1.2-gtk-3.0, python3-distutils, gir1.2-handy-1
Description: Settings app for Tractor
Description: GTK frontend for Tractor
This package is a graphical settings for tractor
which is an app using Python stem to provide
a connection through the onion proxy and sets up
......
desktop/org.tractor.carburetor.desktop /usr/share/applications
desktop/carburetor.svg /usr/share/icons/hicolor/scalable/apps
carburetor/desktop/org.tractor.carburetor.desktop /usr/share/applications
carburetor/desktop/carburetor.svg /usr/share/icons/hicolor/scalable/apps
#!/usr/bin/python3
# Released under GPLv3+ License
# Danial Behzadi<dani.behzi@ubuntu.com>, 2020
# Danial Behzadi <dani.behzi@ubuntu.com>, 2020-2021
"""
carburetor setup file
"""
import re
import setuptools
with open("README.md", "r") as readme:
long_description = readme.read()
with open("debian/changelog", "r") as changelog:
latest = changelog.readline()
version = re.split(r'\(|\)', latest)[1]
with open("debian/control", "r") as control:
for line in control:
if line.startswith("Maintainer: "):
maintainer = re.split(': | <|>', line)
elif line.startswith("Description: "):
description = re.split(': |\n', line)[1]
elif line.startswith("Package: "):
name = line.split()[1]
setuptools.setup(
name=name,
version=version,
author=maintainer[1],
author_email=maintainer[2],
description=description,
name='carburetor',
version='3.6',
author='Danial Behzadi',
author_email='dani.behzi@ubuntu.com',
description='GTK frontend for Tractor',
long_description=long_description,
long_description_content_type="text/markdown",
url="https://framagit.org/tractor/carburetor",
packages=setuptools.find_packages(),
package_data={'carburetor': [
'about.ui', 'main.ui', 'preferences.ui', 'style.css', 'locales']},
include_package_data=True,
project_urls={
"Bug Tracker":
"https://framagit.org/tractor/carburetor/-/issues",
......
......@@ -6,7 +6,7 @@ echo '' > messages.po
for py_file in carburetor/*.py; do
xgettext --from-code utf-8 --language Python -j $py_file
done
for ui_file in carburetor/*.ui; do
for ui_file in carburetor/ui/*.ui; do
xgettext --from-code utf-8 -j $ui_file
done
mv messages.po carburetor/locales/messages.pot
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment