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 *
|
||||
|
|
12
setup.cfg
12
setup.cfg
|
@ -30,9 +30,6 @@ setup_requires =
|
|||
pip >= 10
|
||||
pytest-runner
|
||||
setuptools_git
|
||||
include_package_data = True
|
||||
find_packages =
|
||||
exclude = tests
|
||||
install_requires =
|
||||
appdirs
|
||||
paramiko
|
||||
|
@ -41,6 +38,7 @@ install_requires =
|
|||
python-dateutil
|
||||
keyring
|
||||
borgbackup
|
||||
apscheduler
|
||||
|
||||
[options.extras_require]
|
||||
tests =
|
||||
|
@ -54,8 +52,7 @@ tests =
|
|||
|
||||
[options.entry_points]
|
||||
gui_scripts =
|
||||
vorta = vorta.__main__
|
||||
|
||||
vorta = vorta.__main__:main
|
||||
|
||||
[tool:pytest]
|
||||
addopts = -vs
|
||||
|
@ -68,3 +65,8 @@ filterwarnings =
|
|||
source = src
|
||||
|
||||
[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.config import SETTINGS_DIR
|
||||
|
||||
# Send crashes to Sentry
|
||||
if getattr(sys, 'frozen', False):
|
||||
|
||||
def main():
|
||||
# Send crashes to Sentry
|
||||
if not os.environ.get('NO_SENTRY'):
|
||||
import sentry_sdk
|
||||
sentry_sdk.init("https://a4a23df3e44743d5b5c5f06417a9a809@sentry.io/1311799")
|
||||
|
||||
# Init database
|
||||
sqlite_db = peewee.SqliteDatabase(os.path.join(SETTINGS_DIR, 'settings.db'))
|
||||
vorta.models.init_db(sqlite_db)
|
||||
# Init database
|
||||
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_())
|
||||
app = VortaApp(sys.argv)
|
||||
sys.exit(app.exec_())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
|
@ -100,7 +100,7 @@ class Meta:
|
|||
class WifiSettingModel(pw.Model):
|
||||
"""Save Wifi Settings"""
|
||||
ssid = pw.CharField()
|
||||
last_connected = pw.DateTimeField()
|
||||
last_connected = pw.DateTimeField(null=True)
|
||||
allowed = pw.BooleanField(default=True)
|
||||
profile = pw.ForeignKeyField(BackupProfileModel, default=1)
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ def get_sorted_wifis():
|
|||
wifis = plistlib.load(plist_file)['KnownNetworks']
|
||||
if wifis:
|
||||
for wifi in wifis.values():
|
||||
timestamp = wifi['LastConnected']
|
||||
timestamp = wifi.get('LastConnected', None)
|
||||
ssid = wifi['SSIDString']
|
||||
WifiSettingModel.get_or_create(ssid=ssid, profile=app.profile,
|
||||
defaults={'last_connected': timestamp,
|
||||
|
|
Loading…
Reference in a new issue