home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / xbmc-9.11.exe / scripts / AppleMovieTrailers / default.py next >
Encoding:
Python Source  |  2009-11-03  |  2.9 KB  |  76 lines

  1. # AppleMovieTrailers script revision: 2534 - built with build.bat version 1.0 #
  2.  
  3. # main import's
  4. import sys
  5. import os
  6.  
  7. # Script constants
  8. __scriptname__ = "Apple Movie Trailers"
  9. __author__ = "Apple Movie Trailers (AMT) Team"
  10. __url__ = "http://code.google.com/p/xbmc-scripting/"
  11. __svn_url__ = "http://xbmc-scripting.googlecode.com/svn/trunk/Apple%20Movie%20Trailers"
  12. __credits__ = "XBMC TEAM, freenode/#xbmc-scripting"
  13. __version__ = "pre-0.99.7.3"
  14. __svn_revision__ = "$Revision$"
  15. __XBMC_Revision__ = "22965"
  16.  
  17. def _check_compatible():
  18.     try:
  19.         # spam plugin statistics to log
  20.         xbmc.log( "[SCRIPT] '%s: Version - %s-r%s' initialized", "" ).strip() ), xbmc.LOGNOTICE )
  21.         # get xbmc revision
  22.         xbmc_rev = int( xbmc.getInfoLabel( "System.BuildVersion" ).split( " r" )[ -1 ] )
  23.         # compatible?
  24.         ok = xbmc_rev >= int( __XBMC_Revision__ )
  25.     except:
  26.         # error, so unknown, allow to run
  27.         xbmc_rev = 0
  28.         ok = 2
  29.     # spam revision info
  30.     xbmc.log( "     ** Required XBMC Revision: r%s **" % ( __XBMC_Revision__, ), xbmc.LOGNOTICE )
  31.     xbmc.log( "     ** Found XBMC Revision: r%d [%s] **" % ( xbmc_rev, ( "Not Compatible", "Compatible", "Unknown", )[ ok ], ), xbmc.LOGNOTICE )
  32.     # if not compatible, inform user
  33.     if ( not ok ):
  34.         import xbmcgui
  35.         import os
  36.         # get localized strings
  37.         _ = xbmc.Language( os.getcwd() ).getLocalizedString
  38.         # inform user
  39.         xbmcgui.Dialog().ok( "%s - %s: %s" % ( __script__, _( 32700 ), __version__, ), _( 32701 ) % ( __script__, ), _( 32702 ) % ( __XBMC_Revision__, ), _( 32703 ) )
  40.     #return result
  41.     return ok
  42.  
  43.  
  44. # Shared resources
  45. BASE_RESOURCE_PATH = os.path.join( os.getcwd(), "resources" )
  46. sys.path.append( os.path.join( BASE_RESOURCE_PATH, "lib" ) )
  47. # append the proper platforms folder to our path, xbox is the same as win32
  48. env = ( os.environ.get( "OS", "win32" ), "win32", )[ os.environ.get( "OS", "win32" ) == "xbox" ]
  49. sys.path.append( os.path.join( BASE_RESOURCE_PATH, "platform_libraries", env ) )
  50. # create our language object
  51. __language__ = xbmc.Language( os.getcwd() ).getLocalizedString
  52.  
  53. # Main team credits
  54. __credits_l1__ = __language__( 910 )#"Head Developer & Coder"
  55. __credits_r1__ = "Killarny"
  56. __credits_l2__ = __language__( 911 )#"Coder & Skinning"
  57. __credits_r2__ = "Nuka1195"
  58. __credits_l3__ = __language__( 912 )#"Graphics & Skinning"
  59. __credits_r3__ = "Pike"
  60.  
  61. # additional credits
  62. __add_credits_l1__ = __language__( 1 )#"Xbox Media Center"
  63. __add_credits_r1__ = "Team XBMC"
  64. __add_credits_l2__ = __language__( 913 )#"Usability"
  65. __add_credits_r2__ = "Spiff & JMarshall"
  66. __add_credits_l3__ = __language__( 914 )#"Language File"
  67. __add_credits_r3__ = __language__( 2 )#"Translators name"
  68.  
  69.  
  70. # Start the main gui
  71. if __name__ == "__main__":
  72.     # only run if compatible
  73.     if ( _check_compatible() ):
  74.         # main window
  75.         import gui
  76.