mirror of
https://github.com/borgbase/vorta
synced 2025-01-03 05:36:19 +00:00
Fixes to packaging
This commit is contained in:
parent
cdfe2ecbb7
commit
7eefe354ae
6 changed files with 32 additions and 17 deletions
|
@ -1 +1,2 @@
|
||||||
|
graft src/vorta/assets
|
||||||
recursive-exclude tests *
|
recursive-exclude tests *
|
||||||
|
|
12
setup.cfg
12
setup.cfg
|
@ -30,9 +30,6 @@ setup_requires =
|
||||||
pip >= 10
|
pip >= 10
|
||||||
pytest-runner
|
pytest-runner
|
||||||
setuptools_git
|
setuptools_git
|
||||||
include_package_data = True
|
|
||||||
find_packages =
|
|
||||||
exclude = tests
|
|
||||||
install_requires =
|
install_requires =
|
||||||
appdirs
|
appdirs
|
||||||
paramiko
|
paramiko
|
||||||
|
@ -41,6 +38,7 @@ install_requires =
|
||||||
python-dateutil
|
python-dateutil
|
||||||
keyring
|
keyring
|
||||||
borgbackup
|
borgbackup
|
||||||
|
apscheduler
|
||||||
|
|
||||||
[options.extras_require]
|
[options.extras_require]
|
||||||
tests =
|
tests =
|
||||||
|
@ -54,8 +52,7 @@ tests =
|
||||||
|
|
||||||
[options.entry_points]
|
[options.entry_points]
|
||||||
gui_scripts =
|
gui_scripts =
|
||||||
vorta = vorta.__main__
|
vorta = vorta.__main__:main
|
||||||
|
|
||||||
|
|
||||||
[tool:pytest]
|
[tool:pytest]
|
||||||
addopts = -vs
|
addopts = -vs
|
||||||
|
@ -68,3 +65,8 @@ filterwarnings =
|
||||||
source = src
|
source = src
|
||||||
|
|
||||||
[tox:tox]
|
[tox:tox]
|
||||||
|
envlist = py37
|
||||||
|
|
||||||
|
[tox:testenv]
|
||||||
|
deps=pytest
|
||||||
|
commands=pytest
|
||||||
|
|
8
setup.py
8
setup.py
|
@ -1 +1,7 @@
|
||||||
from setuptools import setup; setup()
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
|
setup(
|
||||||
|
include_package_data=True,
|
||||||
|
packages=find_packages('src'),
|
||||||
|
package_dir={'': 'src'}
|
||||||
|
)
|
||||||
|
|
|
@ -6,14 +6,20 @@
|
||||||
from vorta.application import VortaApp
|
from vorta.application import VortaApp
|
||||||
from vorta.config import SETTINGS_DIR
|
from vorta.config import SETTINGS_DIR
|
||||||
|
|
||||||
# Send crashes to Sentry
|
|
||||||
if getattr(sys, 'frozen', False):
|
|
||||||
import sentry_sdk
|
|
||||||
sentry_sdk.init("https://a4a23df3e44743d5b5c5f06417a9a809@sentry.io/1311799")
|
|
||||||
|
|
||||||
# Init database
|
def main():
|
||||||
sqlite_db = peewee.SqliteDatabase(os.path.join(SETTINGS_DIR, 'settings.db'))
|
# Send crashes to Sentry
|
||||||
vorta.models.init_db(sqlite_db)
|
if not os.environ.get('NO_SENTRY'):
|
||||||
|
import sentry_sdk
|
||||||
|
sentry_sdk.init("https://a4a23df3e44743d5b5c5f06417a9a809@sentry.io/1311799")
|
||||||
|
|
||||||
app = VortaApp(sys.argv)
|
# Init database
|
||||||
sys.exit(app.exec_())
|
sqlite_db = peewee.SqliteDatabase(os.path.join(SETTINGS_DIR, 'settings.db'))
|
||||||
|
vorta.models.init_db(sqlite_db)
|
||||||
|
|
||||||
|
app = VortaApp(sys.argv)
|
||||||
|
sys.exit(app.exec_())
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
|
|
|
@ -100,7 +100,7 @@ class Meta:
|
||||||
class WifiSettingModel(pw.Model):
|
class WifiSettingModel(pw.Model):
|
||||||
"""Save Wifi Settings"""
|
"""Save Wifi Settings"""
|
||||||
ssid = pw.CharField()
|
ssid = pw.CharField()
|
||||||
last_connected = pw.DateTimeField()
|
last_connected = pw.DateTimeField(null=True)
|
||||||
allowed = pw.BooleanField(default=True)
|
allowed = pw.BooleanField(default=True)
|
||||||
profile = pw.ForeignKeyField(BackupProfileModel, default=1)
|
profile = pw.ForeignKeyField(BackupProfileModel, default=1)
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ def get_sorted_wifis():
|
||||||
wifis = plistlib.load(plist_file)['KnownNetworks']
|
wifis = plistlib.load(plist_file)['KnownNetworks']
|
||||||
if wifis:
|
if wifis:
|
||||||
for wifi in wifis.values():
|
for wifi in wifis.values():
|
||||||
timestamp = wifi['LastConnected']
|
timestamp = wifi.get('LastConnected', None)
|
||||||
ssid = wifi['SSIDString']
|
ssid = wifi['SSIDString']
|
||||||
WifiSettingModel.get_or_create(ssid=ssid, profile=app.profile,
|
WifiSettingModel.get_or_create(ssid=ssid, profile=app.profile,
|
||||||
defaults={'last_connected': timestamp,
|
defaults={'last_connected': timestamp,
|
||||||
|
|
Loading…
Reference in a new issue