From 5e88d395dee651175a277092c712249e3898a7d8 Mon Sep 17 00:00:00 2001 From: Matthias Baumgartner Date: Sun, 5 Mar 2023 19:16:22 +0100 Subject: build fixes --- tagit/__init__.py | 3 +++ tagit/apps/desktop.py | 4 ++-- tagit/external/setproperty/README.md | 24 +++++++++++++++++++++++- tagit/external/setproperty/build.py | 5 +++++ tagit/external/setproperty/preprocess.py | 8 ++++++++ tagit/external/setproperty/setup.py | 1 + 6 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 tagit/external/setproperty/build.py create mode 100644 tagit/external/setproperty/preprocess.py (limited to 'tagit') diff --git a/tagit/__init__.py b/tagit/__init__.py index b0c602d..8c4285a 100644 --- a/tagit/__init__.py +++ b/tagit/__init__.py @@ -20,6 +20,9 @@ import collections import os import typing +import kivy.config +kivy.config.Config.set('input', 'mouse', 'mouse,disable_multitouch') + # kivy imports from kivy.resources import resource_add_path import kivy diff --git a/tagit/apps/desktop.py b/tagit/apps/desktop.py index 913f922..149bf30 100644 --- a/tagit/apps/desktop.py +++ b/tagit/apps/desktop.py @@ -32,8 +32,8 @@ def load_data_hook(cfg, store): import pickle import os # fetch data_hook config flags - schema_path = cfg('session', 'data_hook', 'schema') - triples_path = cfg('session', 'data_hook', 'triples') + schema_path = os.path.expanduser(cfg('session', 'data_hook', 'schema')) + triples_path = os.path.expanduser(cfg('session', 'data_hook', 'triples')) # load data if present if os.path.exists(schema_path) and os.path.exists(triples_path): with open(schema_path, 'rb') as ifile: diff --git a/tagit/external/setproperty/README.md b/tagit/external/setproperty/README.md index e579132..4849b6c 100644 --- a/tagit/external/setproperty/README.md +++ b/tagit/external/setproperty/README.md @@ -1,5 +1,27 @@ -build with +# SetProperty + +Analigous to kivy.properties.ListProperty, SetProperty provides a wrapper +that extends python's set() with [Kivy](https://kivy.org) events. + +## Installation + +Note that you'll need Cython to run the following commands. +Install Cython via: + +$ pip install Cython + +or via your system's package manager (e.g., ``sudo apt install cython``). + +Then, cythonize the SetProperty with: + +$ python preprocess.py + +build the shared library from cythonized with: + +$ python build.py build_ext --inplace + +or perform both steps with one command: $ python setup.py build_ext --inplace diff --git a/tagit/external/setproperty/build.py b/tagit/external/setproperty/build.py new file mode 100644 index 0000000..9b3d6ab --- /dev/null +++ b/tagit/external/setproperty/build.py @@ -0,0 +1,5 @@ + +from distutils.core import Extension, setup +ext = Extension(name="setproperty", sources=["setproperty.c"]) +setup(ext_modules=[ext]) + diff --git a/tagit/external/setproperty/preprocess.py b/tagit/external/setproperty/preprocess.py new file mode 100644 index 0000000..7c85b86 --- /dev/null +++ b/tagit/external/setproperty/preprocess.py @@ -0,0 +1,8 @@ + +from distutils.core import Extension +from Cython.Build import cythonize + +ext = Extension(name="setproperty", sources=["setproperty.pyx"]) +cythonize(ext) + + diff --git a/tagit/external/setproperty/setup.py b/tagit/external/setproperty/setup.py index 8500340..bd95d70 100644 --- a/tagit/external/setproperty/setup.py +++ b/tagit/external/setproperty/setup.py @@ -4,3 +4,4 @@ from Cython.Build import cythonize # define an extension that will be cythonized and compiled ext = Extension(name="setproperty", sources=["setproperty.pyx"]) setup(ext_modules=cythonize(ext)) + -- cgit v1.2.3