Skip to content
Browse files

Backports versioning support and `mythpython`. Allows `mythpython --v…

…ersion` printout to be requested for user support purposes.

git-svn-id: http://svn.mythtv.org/svn/branches/release-0-23-fixes@25154 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information...
1 parent d5cd5ea commit e403c63b4c63f38147bec37ec01bbe7b0d73a6f0 @wagnerrp wagnerrp committed Jun 22, 2010
View
1 mythtv/bindings/python/MythTV/MythStatic.py
@@ -4,6 +4,7 @@
Contains any static and global variables for MythTV Python Bindings
"""
+OWN_VERSION = (0,23,0,0)
SCHEMA_VERSION = 1254
MVSCHEMA_VERSION = 1032
NVSCHEMA_VERSION = 1004
View
3 mythtv/bindings/python/MythTV/__init__.py
@@ -36,6 +36,9 @@
else:
exec(import25)
+__version__ = OWN_VERSION
+MythStatic.mysqldb = MySQLdb.__version__
+
if __name__ == '__main__':
banner = 'MythTV Python interactive shell.'
import code
View
34 mythtv/bindings/python/scripts/mythpython
@@ -0,0 +1,34 @@
+#!/usr/local/bin/python
+
+from MythTV import *
+import sys
+
+if __name__ == '__main__':
+ if '--version' in sys.argv:
+ print 'MythTV Python Bindings'
+ print ' local versions'
+ print ' bindings version: ', '.'.join([str(i) for i in MythStatic.OWN_VERSION])
+ import MythTV.ttvdb.tvdb_api
+ print ' ttvdb version: ', str(MythTV.ttvdb.tvdb_api.__version__)
+ import MythTV.tmdb.tmdb_api
+ print ' tmdb version: ', str(MythTV.tmdb.tmdb_api.__version__)
+ print ' external versions'
+ try:
+ import lxml.etree
+ print ' lxml version: ', str(lxml.etree.__version__)
+ except:
+ print ' lxml version: ', 'NOT FOUND'
+ print ' MySQLdb version: ', '.'.join([str(i) for i in MythStatic.mysqldb])
+ sys.exit(0)
+ banner = 'MythTV Python interactive shell.'
+ import code
+ try:
+ import readline, rlcompleter
+ except:
+ pass
+ else:
+ readline.parse_and_bind("tab: complete")
+ banner += ' TAB completion available.'
+ namespace = globals().copy()
+ namespace.update(locals())
+ code.InteractiveConsole(namespace).interact(banner)
View
1 mythtv/bindings/python/setup.py
@@ -8,4 +8,5 @@
description='MythTV Python bindings.',
packages=['MythTV', 'MythTV/tmdb', 'MythTV/ttvdb'],
url=['http://www.mythtv.org/'],
+ scripts=['scripts/mythpython'],
)

0 comments on commit e403c63

Please sign in to comment.
Something went wrong with that request. Please try again.