Skip to content

Commit

Permalink
Python Bindings: Move version info into own file.
Browse files Browse the repository at this point in the history
The version information is generated during 'configue' into
a dedicated file. This separates the version info from other
global and static variables used within the package MythTV.
The 'INSTALL_PREFIX' is also generated on the fly. This will
ease the build process of the Python Bindings in the future.

Refs #731
  • Loading branch information
rcrdnalor committed May 15, 2023
1 parent 74864b5 commit 7913ac1
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 15 deletions.
2 changes: 1 addition & 1 deletion mythtv/bindings/python/MythTV/.gitignore
@@ -1 +1 @@
static.py
_versions.py
5 changes: 3 additions & 2 deletions mythtv/bindings/python/MythTV/__init__.py
Expand Up @@ -21,14 +21,15 @@
'Frontend', 'MythDB', 'MythXML', 'MythMusic', \
'MythVideo']

__all__ = ['static', 'MSearch', 'MythLog', 'StorageGroup']\
__all__ = ['static', '_versions', 'MSearch', 'MythLog', 'StorageGroup']\
+__all_exceptions__\
+__all_utility__\
+__all_system__\
+__all_proto__\
+__all_data__\
+__all_method__

from . import _versions
from . import static
from .exceptions import *
from .logging import *
Expand All @@ -42,6 +43,6 @@
from .methodheap import *


__version__ = OWN_VERSION
__version__ = ".".join(str(x) for x in _versions.OWN_VERSION)
static.dbmodule = dbmodule.__version__

16 changes: 16 additions & 0 deletions mythtv/bindings/python/MythTV/_versions.py.in
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-

"""
Contains static and global variables for MythTV Python Bindings
related to version information.
The file MythTV/_versions.py is usually generated by ./configure.
"""

OWN_VERSION = @MYTHTV_PYTHON_OWN_VERSION@
SCHEMA_VERSION = 1378
NVSCHEMA_VERSION = 1007
MUSICSCHEMA_VERSION = 1025
PROTO_VERSION = '91'
PROTO_TOKEN = 'BuzzOff'
BACKEND_SEP = '[]:[]'
INSTALL_PREFIX = @MYTHTV_INSTALL_PREFIX@
@@ -1,17 +1,11 @@
# -*- coding: utf-8 -*-

"""
Contains any static and global variables for MythTV Python Bindings
Contains static and global variables for MythTV Python Bindings.
Version information is placed in '_versions.py'.
"""

OWN_VERSION = @MYTHTV_PYTHON_OWN_VERSION@
SCHEMA_VERSION = 1378
NVSCHEMA_VERSION = 1007
MUSICSCHEMA_VERSION = 1025
PROTO_VERSION = '91'
PROTO_TOKEN = 'BuzzOff'
BACKEND_SEP = '[]:[]'
INSTALL_PREFIX = '/usr/local'
from MythTV._versions import *

class MARKUP( object ):
MARK_UNSET = -10
Expand Down
7 changes: 4 additions & 3 deletions mythtv/configure
Expand Up @@ -7526,10 +7526,11 @@ sed -e "s/@MYTHTV_VERSION_MAJMIN@/${MYTHTV_VERSION_MAJMIN}/g" \
bindings/python/setup.cfg.in > $TMPPRO
cp_if_changed $TMPPRO bindings/python/setup.cfg

echo "Creating bindings/python/MythTV/static.py"
echo "Creating bindings/python/MythTV/_versions.py"
sed -e "s/@MYTHTV_PYTHON_OWN_VERSION@/${MYTHTV_PYTHON_OWN_VERSION}/g" \
bindings/python/MythTV/static.py.in > $TMPPRO
cp_if_changed $TMPPRO bindings/python/MythTV/static.py
-e "s!@MYTHTV_INSTALL_PREFIX@!${prefix}!g" \
bindings/python/MythTV/_versions.py.in > $TMPPRO
cp_if_changed $TMPPRO bindings/python/MythTV/_versions.py

echo "Creating bindings/python/MythTV/services_api/mythversions.py"
sed -e "s/@MYTHTV_PYTHON_VERSION_LIST@/${MYTHTV_PYTHON_VERSION_LIST}/g" \
Expand Down

0 comments on commit 7913ac1

Please sign in to comment.