Skip to content

Commit

Permalink
Rename Gourmet into the new fork name Gourmand (GourmandRecipeManager#1)
Browse files Browse the repository at this point in the history
* Update README
* Update Github actions to run on main branch
* Update Flatpak and AppImage resources
* Rename all imports and resources to gourmand
* Fix all tests to run for gourmand
  • Loading branch information
cydanil authored Jul 6, 2021
1 parent e8110e3 commit 3f872a4
Show file tree
Hide file tree
Showing 268 changed files with 749 additions and 779 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
app-id: io.github.thinkle.Gourmet
app-id: io.github.GourmandRecipeManager.Gourmand
runtime: org.gnome.Platform
runtime-version: '40'
sdk: org.gnome.Sdk
command: gourmet
command: gourmand

finish-args:
- --filesystem=host
Expand Down Expand Up @@ -34,7 +34,7 @@ modules:
url: https://launchpad.net/intltool/trunk/0.51.0/+download/intltool-0.51.0.tar.gz
sha256: 67c74d94196b153b774ab9f89b2fa6c6ba79352407037c8c14d5aeb334e959cd

- name: gourmet
- name: gourmand
buildsystem: simple
build-options:
build-args:
Expand All @@ -43,8 +43,8 @@ modules:
- python3 -m pip install --upgrade pip setuptools wheel
- pip3 install pyenchant pygobject Sphinx
- pip3 install --prefix=/app .[epub-export,mycookbook,pdf-export,spellcheck,web-import]
- install -Dm644 .flatpak/io.github.thinkle.Gourmet.desktop -t /app/share/applications/
- install -Dm644 .flatpak/io.github.thinkle.Gourmet.svg -t /app/share/icons/hicolor/scalable/apps/
- install -Dm644 data/io.github.GourmandRecipeManager.Gourmand.desktop -t /app/share/applications/
- install -Dm644 data/io.github.GourmandRecipeManager.Gourmand.svg -t /app/share/icons/hicolor/scalable/apps/
sources:
- type: git
url: https://github.com/kirienko/gourmet
url: https://github.com/GourmandRecipeManager/gourmand
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

### Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
<!--- If Gourmet was downloaded from Github, you should have some funny alphanumeric characters
<!--- If Gourmand was downloaded from Github, you should have some funny alphanumeric characters
in the filename, such as the 5ad618be in gourmet-5ad618be-py3-none-any.whl -->
* Operating System:
* Version or commit id:
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ jobs:
wget -c https://github.com/$(wget -q https://github.com/probonopd/go-appimage/releases -O - | grep "appimagetool-.*-x86_64.AppImage" | head -n 1 | cut -d '"' -f 2)
chmod +x appimagetool-*.AppImage
- name: Install Gourmet in AppImage
- name: Install Gourmand in AppImage
run: |
./squashfs-root/AppRun -m pip install --upgrade pip
./squashfs-root/AppRun -m pip install decorator six BeautifulSoup4 html5lib lxml pyenchant pygobject Sphinx
./squashfs-root/AppRun setup.py bdist_wheel
./squashfs-root/AppRun -m pip install .[epub-export,mycookbook,pdf-export,spellcheck,web-import]
./squashfs-root/AppRun -m pip install dist/gourmet*.whl
sed -i -e 's|/opt/python3.8/bin/python3.8|/usr/bin/gourmet|g' ./squashfs-root/AppRun
./squashfs-root/AppRun -m pip install dist/gourmand*.whl
sed -i -e 's|/opt/python3.8/bin/python3.8|/usr/bin/gourmand|g' ./squashfs-root/AppRun
rm squashfs-root/*.desktop
cp .flatpak/io.github.thinkle.Gourmet.desktop squashfs-root/usr/share/applications/io.github.thinkle.Gourmet.desktop
cp .flatpak/io.github.thinkle.Gourmet.desktop squashfs-root/
convert .flatpak/io.github.thinkle.Gourmet.svg squashfs-root/usr/share/icons/hicolor/256x256/apps/io.github.thinkle.Gourmet.png
convert .flatpak/io.github.thinkle.Gourmet.svg squashfs-root/io.github.thinkle.Gourmet.png
cp data/io.github.GourmandRecipeManager.Gourmand.desktop squashfs-root/usr/share/applications/io.github.GourmandRecipeManager.Gourmand.desktop
cp data/io.github.GourmandRecipeManager.Gourmand.desktop squashfs-root/
convert data/io.github.GourmandRecipeManager.Gourmand.svg squashfs-root/usr/share/icons/hicolor/256x256/apps/io.github.GourmandRecipeManager.Gourmand.png
convert data/io.github.GourmandRecipeManager.Gourmand.svg squashfs-root/io.github.GourmandRecipeManager.Gourmand.png
- name: Pack AppImage
run: |
Expand All @@ -45,5 +45,5 @@ jobs:
- name: Upload AppImage
uses: actions/upload-artifact@v2
with:
name: gourmet.AppImage
path: ./Gourmet-*.AppImage
name: gourmand.AppImage
path: ./Gourmand-*.AppImage
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: Build

on:
push:
branches: [ master ]
branches: [ main ]
pull_request:
branches: [ master ]
branches: [ main ]
workflow_dispatch:

jobs:
Expand All @@ -27,11 +27,11 @@ jobs:
- name: Create wheel and source distributions
run: |
python3 setup.py sdist bdist_wheel
mv dist/gourmet-*.tar.gz dist/gourmet-${GITHUB_SHA::8}.tar.gz
mv dist/gourmet-*-py3-none-any.whl dist/gourmet-${GITHUB_SHA::8}-py3-none-any.whl
mv dist/gourmand-*.tar.gz dist/gourmand-${GITHUB_SHA::8}.tar.gz
mv dist/gourmand-*-py3-none-any.whl dist/gourmand-${GITHUB_SHA::8}-py3-none-any.whl
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: gourmet
path: ./dist/gourmet-*
name: gourmand
path: ./dist/gourmand-*
8 changes: 4 additions & 4 deletions .github/workflows/flatpak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ jobs:
- name: Build Flatpak
run: |
flatpak-builder --repo=repo --force-clean build-dir .flatpak/io.github.thinkle.Gourmet.yml
flatpak-builder --repo=repo --force-clean build-dir .flatpak/io.github.GourmandRecipeManager.Gourmand.yml
- name: Build Bundle
run: |
flatpak build-bundle repo gourmet-${GITHUB_SHA::8}.flatpak io.github.thinkle.Gourmet
flatpak build-bundle repo gourmand-${GITHUB_SHA::8}.flatpak io.github.GourmandRecipeManager.Gourmand
- name: Upload Flatpak
uses: actions/upload-artifact@v2
with:
name: gourmet.flatpak
path: ./gourmet-*.flatpak
name: gourmand.flatpak
path: ./gourmand-*.flatpak
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: Tests

on:
push:
branches: [master]
branches: [main]
pull_request:
branches: [master]
branches: [main]
workflow_dispatch:

jobs:
Expand All @@ -32,7 +32,7 @@ jobs:
run: |
sudo pip3 install --upgrade pip setuptools wheel
- name: Install Gourmet
- name: Install Gourmand
run: sudo pip3 install -r development.in

- name: Test with pytest
Expand Down
18 changes: 7 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
# Gourmet Recipe Manager
## Try it. It's good!
![Tests](https://github.com/kirienko/gourmet/workflows/Tests/badge.svg) ![Build](https://github.com/kirienko/gourmet/workflows/Build/badge.svg)
# Gourmand Recipe Manager

![Tests](https://github.com/GourmandRecipeManager/gourmand/workflows/Tests/badge.svg) ![Build](https://github.com/GourmandRecipeManager/gourmand/workflows/Build/badge.svg)

Gourmand is a fork of the Gourmet Recipe Manager: a manager, editor, and organizer for recipes.

# Introduction
Gourmet Recipe Manager is a manager, editor, and organizer for recipes.
It has a plugin architecture which allows you to enable extensions to
Gourmet's base functionality.
For example, there is a nutritional plugin that allows Gourmet to help you
calculate nutritional information for any recipe. There are also a wide variety
of import and export plugins that let Gourmet read and write recipes in various
formats.

# Requirements and Installation

Installation instruction are found in [INSTALL.md](INSTALL.md).

# Issues and Contributions

See the [contribution guide](CONTRIBUTING.md).
File renamed without changes.
File renamed without changes
7 changes: 3 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from wheel.bdist_wheel import bdist_wheel


PACKAGE = 'gourmet'
PACKAGE = 'gourmand'
PACKAGEDIR = Path('src') / PACKAGE
DATADIR = Path('data')
PODIR = Path('po')
Expand All @@ -20,7 +20,7 @@


def get_info(prop: str) -> str:
with open(PACKAGEDIR / 'version.py') as versfile:
with open(PACKAGEDIR / '__version__.py') as versfile:
content = versfile.read()
match = re.search(r'^{} = "(.+)"'.format(prop), content, re.M)
if match is not None:
Expand Down Expand Up @@ -174,7 +174,6 @@ def run(self):
version=get_info('version'),
description=get_info('description'),
author=get_info('author'),
author_email=get_info('author_email'),
maintainer=get_info('maintainer'),
maintainer_email=get_info('maintainer_email'),
url=get_info('url'),
Expand Down Expand Up @@ -209,6 +208,6 @@ def run(self):
},
entry_points={
"gui_scripts": [
"gourmet = gourmet.GourmetRecipeManager:launch_app",
"gourmand = gourmand.main:launch_app",
]}
)
2 changes: 1 addition & 1 deletion src/gourmet/Undo.py → src/gourmand/Undo.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from gi.repository import Gtk

from gourmet.gdebug import debug
from gourmand.gdebug import debug


class UndoMode(Enum):
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions src/gourmand/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if __name__ == '__main__':
from gourmand.GourmetRecipeManager import launch_app
launch_app()
27 changes: 27 additions & 0 deletions src/gourmand/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from gourmand.i18n import _

appname = _("Gourmand Recipe Manager")
copyright = _("Copyright (c) 2004-2021 Thomas M. Hinkle and Contributors.\n"
"Copyright (c) 2021 The Gourmand Team and Contributors")
version = "1.0.0"
url = "ihttps://github.com/GourmandRecipeManager/gourmand"
description = "Recipe Organizer and Shopping List Generator"
long_description = _("""\
Gourmand is an application to store, organize and search recipes.
Features:
* Makes it easy to create shopping lists from recipes.
* Imports recipes from a number of sources, including MealMaster and MasterCook
archives and several popular websites.
* Exports recipes as PDF files, plain text, MealMaster files, HTML web pages,
and a custom XML format for exchange with other Gourmet users.
* Supports linking images with recipes.
* Can calculate nutritional information for recipes based on the ingredients.
""")
author = "Gourmand Team and Contributors"
authors = [] # FIXME: get list of contributors
maintainer = "Cyril Danilevski"
maintainer_email = "[email protected]"
artists = [_("Nyall Dawson (cookie icon)"),
_("Kati Pregartner (splash screen image)")]
license = "GPL v2"
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

from gi.repository import Gtk

from gourmet import cb_extras as cb
from gourmet import dialog_extras as de
from gourmet import gglobals
from gourmet.gdebug import debug
from gourmet.i18n import _
from gourmand import cb_extras as cb
from gourmand import dialog_extras as de
from gourmand import gglobals
from gourmand.gdebug import debug
from gourmand.i18n import _


class DatabaseChooser:
Expand Down
File renamed without changes.
36 changes: 19 additions & 17 deletions src/gourmet/backends/db.py → src/gourmand/backends/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
LargeBinary, Numeric, String, Table, Text, event, func)
from sqlalchemy.sql import and_, case, or_

import gourmet.gglobals as gglobals
import gourmet.recipeIdentifier as recipeIdentifier
import gourmet.version
from gourmet import Undo, convert, image_utils
from gourmet.defaults import lang as defaults
from gourmet.gdebug import TimeAction, debug
from gourmet.gtk_extras.dialog_extras import show_message
from gourmet.i18n import _
from gourmet.keymanager import KeyManager
from gourmet.plugin import DatabasePlugin
from gourmet.plugin_loader import Pluggable, pluggable_method
import gourmand.__version__
import gourmand.gglobals as gglobals
import gourmand.recipeIdentifier as recipeIdentifier
from gourmand import Undo, convert, image_utils
from gourmand.defaults import lang as defaults
from gourmand.gdebug import TimeAction, debug
from gourmand.gtk_extras.dialog_extras import show_message
from gourmand.i18n import _
from gourmand.keymanager import KeyManager
from gourmand.plugin import DatabasePlugin
from gourmand.plugin_loader import Pluggable, pluggable_method

Session = sqlalchemy.orm.sessionmaker()

Expand Down Expand Up @@ -120,13 +120,14 @@ class DBObject:
# categories_table: id -> recipe_id, category_entry_id -> id
# ingredients_table: ingredient_id -> id, id -> recipe_id

def db_url(file: Optional[str]=None, custom_url: Optional[str]=None) -> str:
def db_url(filename: Optional[str]=None,
custom_url: Optional[str]=None) -> str:
if custom_url is not None:
return custom_url
else:
if file is None:
file = os.path.join(gglobals.gourmetdir, 'recipes.db')
return 'sqlite:///' + file
if filename is None:
filename = gglobals.gourmanddir / 'recipes.db'
return 'sqlite:///' + str(filename)

class RecData (Pluggable):

Expand Down Expand Up @@ -171,7 +172,7 @@ def __init__ (self, file: str, url: str):
Pluggable.__init__(self,[DatabasePlugin])
self.setup_tables()
self.metadata.create_all()
self.update_version_info(gourmet.version.version)
self.update_version_info(gourmand.__version__.version)
self._created = True
timer.end()

Expand Down Expand Up @@ -502,6 +503,7 @@ def update_version_info(self, version_string: str):
print('Database older than 0.16.0 -- updating', sv_text)
self.backup_db()
from sqlalchemy.sql.expression import func

# We need to unpickle Booleans that have erroneously remained
# pickled during previous Metakit -> SQLite -> SQLAlchemy
# database migrations.
Expand Down Expand Up @@ -1148,7 +1150,7 @@ def validate_recdic (self, recdic):
recdic['thumb'] = image_utils.image_to_bytes(thumb)
except:
del recdic['image']
print("""Warning: gourmet couldn't recognize the image.
print("""Warning: Gourmand couldn't recognize the image.
Proceding anyway, but here's the traceback should you
wish to investigate.
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from gi.repository import Gtk

from gourmet.i18n import _
from gourmand.i18n import _

from .gdebug import debug
from .gtk_extras import dialog_extras as de
Expand Down
2 changes: 1 addition & 1 deletion src/gourmet/convert.py → src/gourmand/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from gettext import ngettext
from typing import Optional

from gourmet.i18n import _
from gourmand.i18n import _

from .defaults.defaults import lang as defaults
from .gdebug import debug
Expand Down
File renamed without changes.
Loading

0 comments on commit 3f872a4

Please sign in to comment.