diff --git a/.pybuild/cpython3_3.12/build/gourmand/backends/db.py b/.pybuild/cpython3_3.12/build/gourmand/backends/db.py index 188d7100..a059dd33 100644 --- a/.pybuild/cpython3_3.12/build/gourmand/backends/db.py +++ b/.pybuild/cpython3_3.12/build/gourmand/backends/db.py @@ -729,9 +729,16 @@ def fetch_len (self, table, **criteria): """Return the number of rows in table that match criteria """ if criteria: - return select(func.count(criteria)).select_from(table).scalar() - else: - return select(func.count()).select_from(table).scalar() + return select( + [func.count(list(table.primary_key.columns)[0])])\ + .where(*make_simple_select_arg(criteria,table))\ + .execute()\ + .fetchone()[0] + + return select( + [func.count(list(table.primary_key.columns)[0])])\ + .execute()\ + .fetchone()[0] def fetch_join (self, table1, table2, col1, col2, column_names=None, sort_by=None, **criteria): diff --git a/.pybuild/cpython3_3.12/build/gourmand/defaults/defaults_en.py b/.pybuild/cpython3_3.12/build/gourmand/defaults/defaults_en.py index 65cfd7e9..d03f6805 100644 --- a/.pybuild/cpython3_3.12/build/gourmand/defaults/defaults_en.py +++ b/.pybuild/cpython3_3.12/build/gourmand/defaults/defaults_en.py @@ -669,12 +669,12 @@ class Language(AbstractLanguage): ("qt", ["quart", "quarts", "qt.", "Qt", "Qt."]), ("pt", ["pint", "pints", "pt.", "Pt", "Pt."]), ("gallon", ["gallon", "gallons", "gal", "gal."]), - ("ml", ["mililiter", "mililiters", "ml", "ml."]), - ("cl", ["centiliter", "centiliters","cl", "cl."]), - ("dl", ["deciliter", "deciliters", "dl", "dl."]), - ("l", ["liter", "liters", "lit.", "l", "l."]), + ("ml", ["mililiter", "mililiters", "milliliter", "milliliters", "millilitre", "millilitres", "ml", "ml."]), + ("cl", ["centiliter", "centiliters","centilitre", "centilitres", "cl", "cl."]), + ("dl", ["deciliter", "deciliters", "decilitre", "deciilitres", "dl", "dl."]), + ("l", ["liter", "liters", "litre", "litres""lit.", "l", "l."]), ("g", ["grams", "gram", "g.", "g", "gr", "gr."]), - ("mg", ["miligram", "miligrams", "mg", "mg."]), + ("mg", ["miligram", "miligrams", "millogram", "millograms", "mg", "mg."]), ("kg", ["kilogram", "kilograms", "kg", "kg."]), # These names aren"t really convertible, but we want them to # be recognized as units. diff --git a/.pybuild/cpython3_3.12/build/gourmand/defaults/defaults_en_GB.py b/.pybuild/cpython3_3.12/build/gourmand/defaults/defaults_en_GB.py index 515e6029..84f8067a 100644 --- a/.pybuild/cpython3_3.12/build/gourmand/defaults/defaults_en_GB.py +++ b/.pybuild/cpython3_3.12/build/gourmand/defaults/defaults_en_GB.py @@ -578,12 +578,12 @@ class Language(AbstractLanguage): ("qt", ["quart", "quarts", "qt.", "Qt", "Qt."]), ("pt", ["pint", "pints", "pt.", "Pt", "Pt."]), ("gallon", ["gallon", "gallons", "gal", "gal."]), - ("ml", ["mililiter", "mililiters", "ml", "ml."]), - ("cl", ["centiliter", "centiliters","cl", "cl."]), - ("dl", ["deciliter", "deciliters", "dl", "dl."]), - ("l", ["liter", "liters", "lit.", "l", "l."]), + ("ml", ["mililiter", "mililiters", "milliliter", "milliliters", "millilitre", "millilitres", "ml", "ml."]), + ("cl", ["centiliter", "centiliters","centilitre", "centilitres", "cl", "cl."]), + ("dl", ["deciliter", "deciliters", "decilitre", "deciilitres", "dl", "dl."]), + ("l", ["liter", "liters", "litre", "litres""lit.", "l", "l."]), ("g", ["grams", "gram", "g.", "g", "gr", "gr."]), - ("mg", ["miligram", "miligrams", "mg", "mg."]), + ("mg", ["miligram", "miligrams", "millogram", "millograms", "mg", "mg."]), ("kg", ["kilogram", "kilograms", "kg", "kg."]), # These names aren"t really convertible, but we want them to # be recognized as units. diff --git a/.pybuild/cpython3_3.12/build/gourmand/importers/importManager.py b/.pybuild/cpython3_3.12/build/gourmand/importers/importManager.py index e3222d39..39dd55af 100644 --- a/.pybuild/cpython3_3.12/build/gourmand/importers/importManager.py +++ b/.pybuild/cpython3_3.12/build/gourmand/importers/importManager.py @@ -7,7 +7,7 @@ import gourmand.gtk_extras.dialog_extras as de import gourmand.plugin_loader as plugin_loader from gourmand.i18n import _ -#from gourmand.importers.web_importer import import_urls, supported_sites +from gourmand.importers.web_importer import import_urls, supported_sites from gourmand.importers.interactive_importer import import_interactivally from gourmand.plugin import ImporterPlugin, ImportManagerPlugin from gourmand.threadManager import (NotThreadSafe, get_thread_manager, diff --git a/.pybuild/cpython3_3.12/build/gourmand/plugins/field_editor/fieldEditor.py b/.pybuild/cpython3_3.12/build/gourmand/plugins/field_editor/fieldEditor.py index 9740f567..13c65637 100644 --- a/.pybuild/cpython3_3.12/build/gourmand/plugins/field_editor/fieldEditor.py +++ b/.pybuild/cpython3_3.12/build/gourmand/plugins/field_editor/fieldEditor.py @@ -32,9 +32,11 @@ def __init__ (self, rd, rg): }) def __setup_widgets__ (self): + sorted_model = Gtk.TreeModelSort() + #sorted_model.set_sort_column_id(0, Gtk.SortType.ASCENDING) for w in [ 'valueDialog', - 'treeview', + 'treeview', 'model=sorted_model', 'fieldToEditCombo','newValueComboBoxEntry', 'newValueEntry','changeValueButton', 'deleteValueButton','forEachLabel', @@ -83,6 +85,7 @@ def __setup_treeview__ (self): col = Gtk.TreeViewColumn('Value', renderer, text=0) + col.set_sort_column_id(0) self.treeview.append_column(col) self.treeview.get_selection().connect('changed',self.treeViewSelectionChanged) self.treeview.get_selection().set_mode(Gtk.SelectionMode.MULTIPLE) diff --git a/.pybuild/cpython3_3.12/build/gourmand/ui/valueEditor.ui b/.pybuild/cpython3_3.12/build/gourmand/ui/valueEditor.ui index d1d30200..7f391f7f 100644 --- a/.pybuild/cpython3_3.12/build/gourmand/ui/valueEditor.ui +++ b/.pybuild/cpython3_3.12/build/gourmand/ui/valueEditor.ui @@ -61,12 +61,13 @@ True False + True GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC True - False + True diff --git a/debian/gourmand.substvars b/debian/gourmand.substvars index 1ab35a53..ebcf263b 100644 --- a/debian/gourmand.substvars +++ b/debian/gourmand.substvars @@ -1,3 +1,3 @@ -python3:Depends=python3-bs4 (>= 4.10.0), python3-gi, python3-lxml, python3-pil, python3-sqlalchemy (<< 2), python3-toml, python3:any +python3:Depends=python3-bs4 (>= 4.10.0), python3-gi, python3-lxml, python3-pil, python3-recipe-scrapers, python3-sqlalchemy (<< 2), python3-toml, python3:any misc:Depends= misc:Pre-Depends= diff --git a/debian/gourmand/DEBIAN/control b/debian/gourmand/DEBIAN/control index 6ce51ecc..c38f3d03 100644 --- a/debian/gourmand/DEBIAN/control +++ b/debian/gourmand/DEBIAN/control @@ -2,9 +2,9 @@ Package: gourmand Version: 1.1.1 Architecture: all Maintainer: Winship Varner -Installed-Size: 10776 -Depends: python3-bs4 (>= 4.10.0), python3-gi, python3-lxml, python3-pil, python3-sqlalchemy (<< 2), python3-toml, python3:any, python3-gi-cairo, gir1.2-gtk-3.0, python3-reportlab, python3-keyring, python3-argcomplete, python3-gst-1.0 -Recommends: python3-pyglet, python3-gtkspellcheck, gir1.2-poppler-0.18, python3-ebooklib, python3-recipe-scrapers +Installed-Size: 10777 +Depends: python3-bs4 (>= 4.10.0), python3-gi, python3-lxml, python3-pil, python3-recipe-scrapers, python3-sqlalchemy (<< 2), python3-toml, python3:any, python3-gi-cairo, gir1.2-gtk-3.0, python3-reportlab, python3-keyring, python3-argcomplete, python3-gst-1.0 +Recommends: python3-pyglet, python3-gtkspellcheck, gir1.2-poppler-0.18, python3-ebooklib Section: gnome Priority: optional Homepage: https://github.com/GourmandRecipeManager/gourmand diff --git a/debian/gourmand/DEBIAN/md5sums b/debian/gourmand/DEBIAN/md5sums index a91ba28e..50e57656 100644 --- a/debian/gourmand/DEBIAN/md5sums +++ b/debian/gourmand/DEBIAN/md5sums @@ -1,8 +1,8 @@ 501140cfece552486a582c2e4f5d65ed usr/bin/gourmand -acca15615ce244603af116213bb87f55 usr/lib/python3/dist-packages/gourmand-1.1.1.egg-info/PKG-INFO +f536261df8e65275b24d4720f3ead738 usr/lib/python3/dist-packages/gourmand-1.1.1.egg-info/PKG-INFO 68b329da9893e34099c7d8ad5cb9c940 usr/lib/python3/dist-packages/gourmand-1.1.1.egg-info/dependency_links.txt 39f1581e74480f0f6247689c19bf2bcb usr/lib/python3/dist-packages/gourmand-1.1.1.egg-info/entry_points.txt -b7dea96900db6ce57645d31a178750fe usr/lib/python3/dist-packages/gourmand-1.1.1.egg-info/requires.txt +7b61e6a45e9eb22b5e8ffd5c5cf58c49 usr/lib/python3/dist-packages/gourmand-1.1.1.egg-info/requires.txt 60ff9dc9b5e4f74bf73bcc0dbb47ab4a usr/lib/python3/dist-packages/gourmand-1.1.1.egg-info/top_level.txt 8a266edc82f834bc4517a546daef332d usr/lib/python3/dist-packages/gourmand/Undo.py 8c496a9c181adddab1d18d32ebc4362a usr/lib/python3/dist-packages/gourmand/__init__.py @@ -10,7 +10,7 @@ b7dea96900db6ce57645d31a178750fe usr/lib/python3/dist-packages/gourmand-1.1.1.e 2f90ce288dd50b67821c84965f1f83be usr/lib/python3/dist-packages/gourmand/__version__.py 3d69d104145ea69b9d64420f9f099f56 usr/lib/python3/dist-packages/gourmand/backends/DatabaseChooser.py 2b81e648d0b42924563fa3ba2eaf5a9a usr/lib/python3/dist-packages/gourmand/backends/__init__.py -9504cf154317cc8847f0f5cb9095ebfe usr/lib/python3/dist-packages/gourmand/backends/db.py +10a9e52ddc1732341bf14dee2bc57882 usr/lib/python3/dist-packages/gourmand/backends/db.py df34fcbb498437f4a31d70ae8ed674c8 usr/lib/python3/dist-packages/gourmand/backends/default.db 03379fd3eba827fc18afdb77e662cca6 usr/lib/python3/dist-packages/gourmand/batchEditor.py 055251f98e2ee914a90ddb74653f328d usr/lib/python3/dist-packages/gourmand/check_encodings.py @@ -100,8 +100,8 @@ b50618072bf7b9463477eb4a33ef8707 usr/lib/python3/dist-packages/gourmand/data/so 416e924f10d07b83ce39b2eac4572477 usr/lib/python3/dist-packages/gourmand/defaults/abstractLang.py 6d2e40f7a0239070417a64c509700175 usr/lib/python3/dist-packages/gourmand/defaults/defaults.py e188c44054d2083244b3ca30073a5d67 usr/lib/python3/dist-packages/gourmand/defaults/defaults_de.py -17741e7e746b81247a8e485d11105ce9 usr/lib/python3/dist-packages/gourmand/defaults/defaults_en.py -0dc7ab3426ee4f79fc0ec1ffc570730c usr/lib/python3/dist-packages/gourmand/defaults/defaults_en_GB.py +d9663e1034436a09ba2bfc9ddf8ed8d0 usr/lib/python3/dist-packages/gourmand/defaults/defaults_en.py +292c08de408f512f38c9b4aceaef56e7 usr/lib/python3/dist-packages/gourmand/defaults/defaults_en_GB.py aebf1a3b2c65f2146718c864e90c5e5d usr/lib/python3/dist-packages/gourmand/defaults/defaults_es.py c7608f1a719400af87617db418d20b4d usr/lib/python3/dist-packages/gourmand/defaults/defaults_fr.py abcfb069fff444a7a16899a6cf0a5a41 usr/lib/python3/dist-packages/gourmand/defaults/defaults_nl.py @@ -140,7 +140,7 @@ f144ae92680903a8a7a07d7bcd338cd1 usr/lib/python3/dist-packages/gourmand/gtk_ext d41d8cd98f00b204e9800998ecf8427e usr/lib/python3/dist-packages/gourmand/importers/__init__.py ae16c81929484c0d46836cd6fd314a9e usr/lib/python3/dist-packages/gourmand/importers/clipboard_importer.py b326807152e549857bf2c77651f2e0c9 usr/lib/python3/dist-packages/gourmand/importers/generic_recipe_parser.py -829297b889cd800e56e93785d40e3a36 usr/lib/python3/dist-packages/gourmand/importers/importManager.py +688046ad935fe3130cc73b50d1db6471 usr/lib/python3/dist-packages/gourmand/importers/importManager.py cb7b3441a94c4780c36a9cdc2599cf00 usr/lib/python3/dist-packages/gourmand/importers/importer.py bb01b0a79ffbfa95164eccb96af96b20 usr/lib/python3/dist-packages/gourmand/importers/interactive_importer.py 3c87fd23bcf155d5bae91150b690039e usr/lib/python3/dist-packages/gourmand/importers/plaintext_importer.py @@ -180,7 +180,7 @@ e3317dc852cb0e5d1fdb3daed60e0097 usr/lib/python3/dist-packages/gourmand/plugins a7795f53ef1801c6feec7690d47857a6 usr/lib/python3/dist-packages/gourmand/plugins/email_plugin/recipe_emailer.py d6df165ec6b821f711f9076e3b80f0fd usr/lib/python3/dist-packages/gourmand/plugins/field_editor.gourmet-plugin dbfa20d4f127c706eabfbc0f57aa4e8d usr/lib/python3/dist-packages/gourmand/plugins/field_editor/__init__.py -de10a71b669dd7109fc7668f60addb64 usr/lib/python3/dist-packages/gourmand/plugins/field_editor/fieldEditor.py +da2402b418a5683d6edf43ba69b3a962 usr/lib/python3/dist-packages/gourmand/plugins/field_editor/fieldEditor.py c6b3243d4601367d557e3756cee22f6b usr/lib/python3/dist-packages/gourmand/plugins/import_export/epub.gourmet-plugin 6179ded23bd29314ba5f49436d40b4b5 usr/lib/python3/dist-packages/gourmand/plugins/import_export/epub_plugin/__init__.py ef52e97e7b135d1330e278176d7910db usr/lib/python3/dist-packages/gourmand/plugins/import_export/epub_plugin/epub_exporter.py @@ -300,7 +300,7 @@ b039dc676724ea54fc007246b6354206 usr/lib/python3/dist-packages/gourmand/ui/nutr 971b6d0391407465e1785c681d612f33 usr/lib/python3/dist-packages/gourmand/ui/recipe_index.ui 800ea7bb11b0ca4652acf8fdbd583bbb usr/lib/python3/dist-packages/gourmand/ui/shopCatEditor.ui 20265f7aede97b2f08daa848d3c83b0a usr/lib/python3/dist-packages/gourmand/ui/timerDialog.ui -b09698b9bcdf8a5b34fcb0c557dd4d4d usr/lib/python3/dist-packages/gourmand/ui/valueEditor.ui +fc94384de90b71f5c32c7e7b32659f22 usr/lib/python3/dist-packages/gourmand/ui/valueEditor.ui a7d8914d850c1ec41276e4d103c465b5 usr/share/applications/io.github.GourmandRecipeManager.Gourmand.desktop 5d6c3dfe7cc937bb38081d96d2007756 usr/share/doc-base/gourmand.gourmand 3234117f1c29d2137981f1391c2816df usr/share/doc/gourmand/README.Debian diff --git a/debian/gourmand/usr/lib/python3/dist-packages/gourmand/backends/db.py b/debian/gourmand/usr/lib/python3/dist-packages/gourmand/backends/db.py index 188d7100..a059dd33 100644 --- a/debian/gourmand/usr/lib/python3/dist-packages/gourmand/backends/db.py +++ b/debian/gourmand/usr/lib/python3/dist-packages/gourmand/backends/db.py @@ -729,9 +729,16 @@ def fetch_len (self, table, **criteria): """Return the number of rows in table that match criteria """ if criteria: - return select(func.count(criteria)).select_from(table).scalar() - else: - return select(func.count()).select_from(table).scalar() + return select( + [func.count(list(table.primary_key.columns)[0])])\ + .where(*make_simple_select_arg(criteria,table))\ + .execute()\ + .fetchone()[0] + + return select( + [func.count(list(table.primary_key.columns)[0])])\ + .execute()\ + .fetchone()[0] def fetch_join (self, table1, table2, col1, col2, column_names=None, sort_by=None, **criteria): diff --git a/debian/gourmand/usr/lib/python3/dist-packages/gourmand/defaults/defaults_en.py b/debian/gourmand/usr/lib/python3/dist-packages/gourmand/defaults/defaults_en.py index 65cfd7e9..d03f6805 100644 --- a/debian/gourmand/usr/lib/python3/dist-packages/gourmand/defaults/defaults_en.py +++ b/debian/gourmand/usr/lib/python3/dist-packages/gourmand/defaults/defaults_en.py @@ -669,12 +669,12 @@ class Language(AbstractLanguage): ("qt", ["quart", "quarts", "qt.", "Qt", "Qt."]), ("pt", ["pint", "pints", "pt.", "Pt", "Pt."]), ("gallon", ["gallon", "gallons", "gal", "gal."]), - ("ml", ["mililiter", "mililiters", "ml", "ml."]), - ("cl", ["centiliter", "centiliters","cl", "cl."]), - ("dl", ["deciliter", "deciliters", "dl", "dl."]), - ("l", ["liter", "liters", "lit.", "l", "l."]), + ("ml", ["mililiter", "mililiters", "milliliter", "milliliters", "millilitre", "millilitres", "ml", "ml."]), + ("cl", ["centiliter", "centiliters","centilitre", "centilitres", "cl", "cl."]), + ("dl", ["deciliter", "deciliters", "decilitre", "deciilitres", "dl", "dl."]), + ("l", ["liter", "liters", "litre", "litres""lit.", "l", "l."]), ("g", ["grams", "gram", "g.", "g", "gr", "gr."]), - ("mg", ["miligram", "miligrams", "mg", "mg."]), + ("mg", ["miligram", "miligrams", "millogram", "millograms", "mg", "mg."]), ("kg", ["kilogram", "kilograms", "kg", "kg."]), # These names aren"t really convertible, but we want them to # be recognized as units. diff --git a/debian/gourmand/usr/lib/python3/dist-packages/gourmand/defaults/defaults_en_GB.py b/debian/gourmand/usr/lib/python3/dist-packages/gourmand/defaults/defaults_en_GB.py index 515e6029..84f8067a 100644 --- a/debian/gourmand/usr/lib/python3/dist-packages/gourmand/defaults/defaults_en_GB.py +++ b/debian/gourmand/usr/lib/python3/dist-packages/gourmand/defaults/defaults_en_GB.py @@ -578,12 +578,12 @@ class Language(AbstractLanguage): ("qt", ["quart", "quarts", "qt.", "Qt", "Qt."]), ("pt", ["pint", "pints", "pt.", "Pt", "Pt."]), ("gallon", ["gallon", "gallons", "gal", "gal."]), - ("ml", ["mililiter", "mililiters", "ml", "ml."]), - ("cl", ["centiliter", "centiliters","cl", "cl."]), - ("dl", ["deciliter", "deciliters", "dl", "dl."]), - ("l", ["liter", "liters", "lit.", "l", "l."]), + ("ml", ["mililiter", "mililiters", "milliliter", "milliliters", "millilitre", "millilitres", "ml", "ml."]), + ("cl", ["centiliter", "centiliters","centilitre", "centilitres", "cl", "cl."]), + ("dl", ["deciliter", "deciliters", "decilitre", "deciilitres", "dl", "dl."]), + ("l", ["liter", "liters", "litre", "litres""lit.", "l", "l."]), ("g", ["grams", "gram", "g.", "g", "gr", "gr."]), - ("mg", ["miligram", "miligrams", "mg", "mg."]), + ("mg", ["miligram", "miligrams", "millogram", "millograms", "mg", "mg."]), ("kg", ["kilogram", "kilograms", "kg", "kg."]), # These names aren"t really convertible, but we want them to # be recognized as units. diff --git a/debian/gourmand/usr/lib/python3/dist-packages/gourmand/importers/importManager.py b/debian/gourmand/usr/lib/python3/dist-packages/gourmand/importers/importManager.py index e3222d39..39dd55af 100644 --- a/debian/gourmand/usr/lib/python3/dist-packages/gourmand/importers/importManager.py +++ b/debian/gourmand/usr/lib/python3/dist-packages/gourmand/importers/importManager.py @@ -7,7 +7,7 @@ import gourmand.gtk_extras.dialog_extras as de import gourmand.plugin_loader as plugin_loader from gourmand.i18n import _ -#from gourmand.importers.web_importer import import_urls, supported_sites +from gourmand.importers.web_importer import import_urls, supported_sites from gourmand.importers.interactive_importer import import_interactivally from gourmand.plugin import ImporterPlugin, ImportManagerPlugin from gourmand.threadManager import (NotThreadSafe, get_thread_manager, diff --git a/debian/gourmand/usr/lib/python3/dist-packages/gourmand/plugins/field_editor/fieldEditor.py b/debian/gourmand/usr/lib/python3/dist-packages/gourmand/plugins/field_editor/fieldEditor.py index 9740f567..13c65637 100644 --- a/debian/gourmand/usr/lib/python3/dist-packages/gourmand/plugins/field_editor/fieldEditor.py +++ b/debian/gourmand/usr/lib/python3/dist-packages/gourmand/plugins/field_editor/fieldEditor.py @@ -32,9 +32,11 @@ def __init__ (self, rd, rg): }) def __setup_widgets__ (self): + sorted_model = Gtk.TreeModelSort() + #sorted_model.set_sort_column_id(0, Gtk.SortType.ASCENDING) for w in [ 'valueDialog', - 'treeview', + 'treeview', 'model=sorted_model', 'fieldToEditCombo','newValueComboBoxEntry', 'newValueEntry','changeValueButton', 'deleteValueButton','forEachLabel', @@ -83,6 +85,7 @@ def __setup_treeview__ (self): col = Gtk.TreeViewColumn('Value', renderer, text=0) + col.set_sort_column_id(0) self.treeview.append_column(col) self.treeview.get_selection().connect('changed',self.treeViewSelectionChanged) self.treeview.get_selection().set_mode(Gtk.SelectionMode.MULTIPLE) diff --git a/debian/gourmand/usr/lib/python3/dist-packages/gourmand/ui/valueEditor.ui b/debian/gourmand/usr/lib/python3/dist-packages/gourmand/ui/valueEditor.ui index d1d30200..7f391f7f 100644 --- a/debian/gourmand/usr/lib/python3/dist-packages/gourmand/ui/valueEditor.ui +++ b/debian/gourmand/usr/lib/python3/dist-packages/gourmand/ui/valueEditor.ui @@ -61,12 +61,13 @@ True False + True GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC True - False + True diff --git a/development.in b/development.in index 71af1762..5fc54460 100644 --- a/development.in +++ b/development.in @@ -1,4 +1,4 @@ ---editable .[epub-export,mycookbook,pdf-export,spellcheck,recipe_scrapers] +--editable .[epub-export,mycookbook,pdf-export,spellcheck] dogtail flake8 isort diff --git a/docs/contributing.md b/docs/contributing.md index 4c9f2fdd..fd306a20 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -141,4 +141,15 @@ It is run with [pytest](https://docs.pytest.org/): pytest ``` -Most modern python IDEs have support for running the tests usin pytest. +Most modern python IDEs have support for running the tests using pytest. + +## Debian Package + +Here is how the Debian package is built: + +```bash +pip3 install -e . +dh_make --indep --createorig --native --packagename gourmand_1.1.1 +(deactivate; dpkg-buildpackage -us -uc -b) + +``` diff --git a/setup.py b/setup.py index 67a8b20b..cf773ae8 100755 --- a/setup.py +++ b/setup.py @@ -195,14 +195,14 @@ def run(self): 'pygobject>=3.40.1', 'sqlalchemy<2', 'toml>=0.10.2', - #'recipe-scrapers>=14.27.0', + 'recipe-scrapers>=14.27.0', ], extras_require={ 'epub-export': ['ebooklib>=0.17.1'], 'pdf-export': ['reportlab>=3.5.67'], 'spellcheck': ['pyenchant', 'pygtkspellcheck'], - 'recipe_scrapers' : ['python3-recipe-scrapers'] + #'recipe_scrapers' : ['python3-recipe-scrapers'] }, cmdclass={ 'bdist_wheel': BuildWheel, diff --git a/src/gourmand/backends/db.py b/src/gourmand/backends/db.py index 188d7100..a059dd33 100644 --- a/src/gourmand/backends/db.py +++ b/src/gourmand/backends/db.py @@ -729,9 +729,16 @@ def fetch_len (self, table, **criteria): """Return the number of rows in table that match criteria """ if criteria: - return select(func.count(criteria)).select_from(table).scalar() - else: - return select(func.count()).select_from(table).scalar() + return select( + [func.count(list(table.primary_key.columns)[0])])\ + .where(*make_simple_select_arg(criteria,table))\ + .execute()\ + .fetchone()[0] + + return select( + [func.count(list(table.primary_key.columns)[0])])\ + .execute()\ + .fetchone()[0] def fetch_join (self, table1, table2, col1, col2, column_names=None, sort_by=None, **criteria): diff --git a/src/gourmand/defaults/defaults_en.py b/src/gourmand/defaults/defaults_en.py index 65cfd7e9..d03f6805 100644 --- a/src/gourmand/defaults/defaults_en.py +++ b/src/gourmand/defaults/defaults_en.py @@ -669,12 +669,12 @@ class Language(AbstractLanguage): ("qt", ["quart", "quarts", "qt.", "Qt", "Qt."]), ("pt", ["pint", "pints", "pt.", "Pt", "Pt."]), ("gallon", ["gallon", "gallons", "gal", "gal."]), - ("ml", ["mililiter", "mililiters", "ml", "ml."]), - ("cl", ["centiliter", "centiliters","cl", "cl."]), - ("dl", ["deciliter", "deciliters", "dl", "dl."]), - ("l", ["liter", "liters", "lit.", "l", "l."]), + ("ml", ["mililiter", "mililiters", "milliliter", "milliliters", "millilitre", "millilitres", "ml", "ml."]), + ("cl", ["centiliter", "centiliters","centilitre", "centilitres", "cl", "cl."]), + ("dl", ["deciliter", "deciliters", "decilitre", "deciilitres", "dl", "dl."]), + ("l", ["liter", "liters", "litre", "litres""lit.", "l", "l."]), ("g", ["grams", "gram", "g.", "g", "gr", "gr."]), - ("mg", ["miligram", "miligrams", "mg", "mg."]), + ("mg", ["miligram", "miligrams", "millogram", "millograms", "mg", "mg."]), ("kg", ["kilogram", "kilograms", "kg", "kg."]), # These names aren"t really convertible, but we want them to # be recognized as units. diff --git a/src/gourmand/defaults/defaults_en_GB.py b/src/gourmand/defaults/defaults_en_GB.py index 515e6029..84f8067a 100644 --- a/src/gourmand/defaults/defaults_en_GB.py +++ b/src/gourmand/defaults/defaults_en_GB.py @@ -578,12 +578,12 @@ class Language(AbstractLanguage): ("qt", ["quart", "quarts", "qt.", "Qt", "Qt."]), ("pt", ["pint", "pints", "pt.", "Pt", "Pt."]), ("gallon", ["gallon", "gallons", "gal", "gal."]), - ("ml", ["mililiter", "mililiters", "ml", "ml."]), - ("cl", ["centiliter", "centiliters","cl", "cl."]), - ("dl", ["deciliter", "deciliters", "dl", "dl."]), - ("l", ["liter", "liters", "lit.", "l", "l."]), + ("ml", ["mililiter", "mililiters", "milliliter", "milliliters", "millilitre", "millilitres", "ml", "ml."]), + ("cl", ["centiliter", "centiliters","centilitre", "centilitres", "cl", "cl."]), + ("dl", ["deciliter", "deciliters", "decilitre", "deciilitres", "dl", "dl."]), + ("l", ["liter", "liters", "litre", "litres""lit.", "l", "l."]), ("g", ["grams", "gram", "g.", "g", "gr", "gr."]), - ("mg", ["miligram", "miligrams", "mg", "mg."]), + ("mg", ["miligram", "miligrams", "millogram", "millograms", "mg", "mg."]), ("kg", ["kilogram", "kilograms", "kg", "kg."]), # These names aren"t really convertible, but we want them to # be recognized as units. diff --git a/src/gourmand/importers/importManager.py b/src/gourmand/importers/importManager.py index e3222d39..39dd55af 100644 --- a/src/gourmand/importers/importManager.py +++ b/src/gourmand/importers/importManager.py @@ -7,7 +7,7 @@ import gourmand.gtk_extras.dialog_extras as de import gourmand.plugin_loader as plugin_loader from gourmand.i18n import _ -#from gourmand.importers.web_importer import import_urls, supported_sites +from gourmand.importers.web_importer import import_urls, supported_sites from gourmand.importers.interactive_importer import import_interactivally from gourmand.plugin import ImporterPlugin, ImportManagerPlugin from gourmand.threadManager import (NotThreadSafe, get_thread_manager, diff --git a/src/gourmand/plugins/field_editor/fieldEditor.py b/src/gourmand/plugins/field_editor/fieldEditor.py index 9740f567..13c65637 100644 --- a/src/gourmand/plugins/field_editor/fieldEditor.py +++ b/src/gourmand/plugins/field_editor/fieldEditor.py @@ -32,9 +32,11 @@ def __init__ (self, rd, rg): }) def __setup_widgets__ (self): + sorted_model = Gtk.TreeModelSort() + #sorted_model.set_sort_column_id(0, Gtk.SortType.ASCENDING) for w in [ 'valueDialog', - 'treeview', + 'treeview', 'model=sorted_model', 'fieldToEditCombo','newValueComboBoxEntry', 'newValueEntry','changeValueButton', 'deleteValueButton','forEachLabel', @@ -83,6 +85,7 @@ def __setup_treeview__ (self): col = Gtk.TreeViewColumn('Value', renderer, text=0) + col.set_sort_column_id(0) self.treeview.append_column(col) self.treeview.get_selection().connect('changed',self.treeViewSelectionChanged) self.treeview.get_selection().set_mode(Gtk.SelectionMode.MULTIPLE) diff --git a/src/gourmand/ui/valueEditor.ui b/src/gourmand/ui/valueEditor.ui index d1d30200..7f391f7f 100644 --- a/src/gourmand/ui/valueEditor.ui +++ b/src/gourmand/ui/valueEditor.ui @@ -61,12 +61,13 @@ True False + True GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC True - False + True diff --git a/tests/test_web_importer.py b/tests/test_web_importer.py index 9af19740..65fce76b 100644 --- a/tests/test_web_importer.py +++ b/tests/test_web_importer.py @@ -3,7 +3,7 @@ gi.require_version("Gtk", "3.0") from gourmand import gglobals # noqa: import not at top -#from gourmand.importers.web_importer import import_urls # noqa +from gourmand.importers.web_importer import import_urls # noqa @pytest.mark.skip("Broken as of 20220813") @pytest.mark.parametrize(