Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Advertising

svn_repo_installer_test_fix.patc
Wednesday, October 14th, 2009 at 4:33:50pm MDT 

  1. diff -Naur SVN Repo Installer/installerAPI/xbmcplugin_actions.py SVN Repo Installer.fix/installerAPI/xbmcplugin_actions.py
  2. --- SVN Repo Installer/installerAPI/xbmcplugin_actions.py       2009-10-14 17:04:02.748858593 -0500
  3. +++ SVN Repo Installer.fix/installerAPI/xbmcplugin_actions.py   2009-10-14 00:07:21.059126995 -0500
  4. @@ -15,7 +15,7 @@
  5.  
  6.  
  7.  class Main:
  8.  
  9.  
  10.  
  11. -       INSTALLED_ITEMS_FILENAME = os.path.join( os.getcwd(), "installed_items.dat" )
  12.  
  13. +       INSTALLED_ITEMS_FILENAME = os.path.join( os.path.dirname(os.path.dirname(__file__)), "installed_items.dat" )
  14.  
  15.         
  16.  
  17.         def __init__( self ):
  18.  
  19.                log( "%s started!" % self.__class__ )
  20.  
  21. diff -Naur SVN Repo Installer/installerAPI/xbmcplugin_downloader.py SVN Repo Installer.fix/installerAPI/xbmcplugin_downloader.py
  22. --- SVN Repo Installer/installerAPI/xbmcplugin_downloader.py    2009-10-14 17:04:02.768870537 -0500
  23. +++ SVN Repo Installer.fix/installerAPI/xbmcplugin_downloader.py        2009-10-14 16:12:12.632504190 -0500
  24. @@ -74,7 +74,7 @@
  25.  
  26.  
  27.         def _get_repo_info( self ):
  28.  
  29.                # path to info file
  30.  
  31. -              repopath = os.path.join( os.getcwd(), "resources", "repositories", self.args.repo, "repo.xml" )
  32.  
  33. +              repopath = os.path.join( os.path.dirname(os.path.dirname(__file__)), "resources", "repositories", self.args.repo, "repo.xml" )
  34.  
  35.                try:
  36.  
  37.                       # grab a file object
  38.  
  39.                       fileobject = open( repopath, "r" )
  40.  
  41. @@ -109,7 +109,7 @@
  42.                log("> _update_all()")
  43.  
  44.                """ Download and install all new Addons as stored in update file """
  45.  
  46.                # eg 'download_url="%2Ftrunk%2Fplugins%2Fmusic/iTunes%2F"&repo=\'xbmc-addons\'&install=""&ioffset=2&voffset=0'
  47.  
  48. -              fn = os.path.join( os.getcwd(), "update_all.dat" )
  49.  
  50. +              fn = os.path.join( os.path.dirname(os.path.dirname(__file__)), "update_all.dat" )
  51.  
  52.                items = loadFileObj(fn)
  53.  
  54.                if items:
  55.  
  56.                       if xbmcgui.Dialog().yesno( __plugin__, xbmc.getLocalizedString( 30019 ) + " ?", "", "", xbmc.getLocalizedString( 30020 ), xbmc.getLocalizedString( 30021 ) ):
  57.  
  58. @@ -138,7 +138,9 @@
  59.         def _download_item( self, forceInstall=False ):
  60.  
  61.                log("> _download_item() forceInstall=%s" % forceInstall)
  62.  
  63.                try:
  64.  
  65. -                     if ( forceInstall or xbmcgui.Dialog().yesno( self.title, xbmc.getLocalizedString( 30000 ), "", "", xbmc.getLocalizedString( 30020 ), xbmc.getLocalizedString( 30021 ) ) ):
  66.  
  67. +#                  if ( forceInstall or xbmcgui.Dialog().yesno( self.title, xbmc.getLocalizedString( 30000 ), "", "", xbmc.getLocalizedString( 30020 ), xbmc.getLocalizedString( 30021 ) ) ):
  68.  
  69. +                     if ( forceInstall or 1 ):
  70.  
  71. +#                        log("NOTENOTENOTE self.dialog.create( %s, %s, %s )" % ( self.title, xbmc.getLocalizedString( 30002 ), xbmc.getLocalizedString( 30003 )))
  72.  
  73.                              self.dialog.create( self.title, xbmc.getLocalizedString( 30002 ), xbmc.getLocalizedString( 30003 ) )
  74.  
  75.                              asset_files = []
  76.  
  77.                              folders = [ self.args.download_url.replace( " ", "%20" ) ]
  78.  
  79. diff -Naur SVN Repo Installer/installerAPI/xbmcplugin_info.py SVN Repo Installer.fix/installerAPI/xbmcplugin_info.py
  80. --- SVN Repo Installer/installerAPI/xbmcplugin_info.py  2009-10-14 17:04:02.768870537 -0500
  81. +++ SVN Repo Installer.fix/installerAPI/xbmcplugin_info.py      2009-10-14 15:42:22.852682703 -0500
  82. @@ -22,7 +22,7 @@
  83.                self.buttons = {}
  84.  
  85.  
  86.  
  87.         def onInit( self ):
  88.  
  89. -              xbmcgui.lock()
  90.  
  91. +              #xbmcgui.lock()
  92.  
  93.  
  94.  
  95.                thumb = xbmc.translatePath(self.info.get('thumb', ''))
  96.  
  97.                if thumb:
  98.  
  99. @@ -50,7 +50,7 @@
  100.                       id = btnIDs[btnName]
  101.  
  102.                       self.getControl( id ).setEnabled( isEnabled )
  103.  
  104.  
  105.  
  106. -              xbmcgui.unlock()
  107.  
  108. +              #xbmcgui.unlock()
  109.  
  110.  
  111.  
  112.         def showChangelog(self):
  113.  
  114.                self.getControl( 30 ).setText(self.info.get('changelog',''))
  115.  
  116. @@ -96,7 +96,7 @@
  117.  ########################################################################################################################
  118.  
  119.  class Main:
  120.  
  121.  
  122.  
  123. -       INSTALLED_ITEMS_FILENAME = os.path.join( os.getcwd(), "installed_items.dat" )
  124.  
  125. +       INSTALLED_ITEMS_FILENAME = os.path.join( os.path.dirname(os.path.dirname(__file__)), "installed_items.dat" )
  126.  
  127.  
  128.  
  129.         def __init__( self, *args, **kwargs):
  130.  
  131.                log( "%s started!" % self.__class__ )
  132.  
  133. @@ -168,7 +168,7 @@
  134.                       buttons['uninstall'] = False
  135.  
  136.  
  137.  
  138.                while info:
  139.  
  140. -                     action = InfoDialog( InfoDialog.XML_FILENAME, os.getcwd(), "Default" ).ask( info, buttons )
  141.  
  142. +                     action = InfoDialog( InfoDialog.XML_FILENAME, os.path.dirname(os.path.dirname(__file__)), "Default" ).ask( info, buttons )
  143.  
  144.                       if not action:
  145.  
  146.                              break
  147.  
  148.                       elif action == "install":
  149.  
  150. diff -Naur SVN Repo Installer/installerAPI/xbmcplugin_lib.py SVN Repo Installer.fix/installerAPI/xbmcplugin_lib.py
  151. --- SVN Repo Installer/installerAPI/xbmcplugin_lib.py   2009-10-14 17:04:02.748858593 -0500
  152. +++ SVN Repo Installer.fix/installerAPI/xbmcplugin_lib.py       2009-10-14 00:07:25.149125947 -0500
  153. @@ -85,7 +85,7 @@
  154.  #####################################################################################################
  155.  
  156.  def get_repo_info( repo ):
  157.  
  158.         # path to info file
  159.  
  160. -       repopath = os.path.join( os.getcwd(), "resources", "repositories", repo, "repo.xml" )
  161.  
  162. +       repopath = os.path.join( os.path.dirname(os.path.dirname(__file__)), "resources", "repositories", repo, "repo.xml" )
  163.  
  164.         try:
  165.  
  166.                info = open( repopath, "r" ).read()
  167.  
  168.                # repo's base url
  169.  
  170. @@ -103,9 +103,9 @@
  171.  #####################################################################################################
  172.  
  173.  def load_repos( ):
  174.  
  175.         repo_list = []
  176.  
  177. -       repos = os.listdir( os.path.join( os.getcwd(), "resources", "repositories" ) )
  178.  
  179. +       repos = os.listdir( os.path.join( os.path.dirname(os.path.dirname(__file__)), "resources", "repositories" ) )
  180.  
  181.         for repo in repos:
  182.  
  183. -              if ("(tagged)" not in repo and repo != ".svn") and (os.path.isdir( os.path.join( os.getcwd(), "resources", "repositories", repo ) ) ):
  184.  
  185. +              if ("(tagged)" not in repo and repo != ".svn") and (os.path.isdir( os.path.join( os.path.dirname(os.path.dirname(__file__)), "resources", "repositories", repo ) ) ):
  186.  
  187.                       repo_list.append( repo )
  188.  
  189.         log("load_repos() %s" % repo_list)
  190.  
  191.         return repo_list
  192.  
  193. diff -Naur SVN Repo Installer/installerAPI/xbmcplugin_list.py SVN Repo Installer.fix/installerAPI/xbmcplugin_list.py
  194. --- SVN Repo Installer/installerAPI/xbmcplugin_list.py  2009-10-14 17:04:02.765525121 -0500
  195. +++ SVN Repo Installer.fix/installerAPI/xbmcplugin_list.py      2009-10-14 13:11:00.623589598 -0500
  196. @@ -62,7 +62,7 @@
  197.  class Main:
  198.  
  199.         # base path
  200.  
  201.         BASE_CACHE_PATH = os.path.join( xbmc.translatePath( "special://profile/" ), "Thumbnails", "Pictures" )
  202.  
  203. -       INSTALLED_ITEMS_FILENAME = os.path.join( os.getcwd(), "installed_items.dat" )
  204.  
  205. +       INSTALLED_ITEMS_FILENAME = os.path.join( os.path.dirname(os.path.dirname(__file__)), "installed_items.dat" )
  206.  
  207.  
  208.  
  209.         def __init__( self ):
  210.  
  211.                log( "%s init!" % self.__class__ )
  212.  
  213. @@ -89,7 +89,7 @@
  214.                xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=ok )
  215.  
  216.  
  217.  
  218.         def _clear_log( self, repo ):
  219.  
  220. -              base_path = os.path.join( xbmc.translatePath( "special://profile/" ), "plugin_data", "programs", os.path.basename( os.getcwd() ) )
  221.  
  222. +              base_path = os.path.join( xbmc.translatePath( "special://profile/" ), "plugin_data", "programs", os.path.basename( __file__ ) )
  223.  
  224.                for page in range( 3 ):
  225.  
  226.                       path = os.path.join( base_path, "%s%d.txt" % ( repo, page, ) )
  227.  
  228.                       # remove log file
  229.  
  230. @@ -113,7 +113,7 @@
  231.                       # set the default icon
  232.  
  233.                       icon = "DefaultFolder.png"
  234.  
  235.                       # set thumbnail
  236.  
  237. -                     thumbnail = os.path.join( os.getcwd(), "resources", "media", "update_checker.png" )
  238.  
  239. +                     thumbnail = os.path.join( os.path.dirname(os.path.dirname(__file__)), "resources", "media", "update_checker.png" )
  240.  
  241.                       # create our listitem, fixing title
  242.  
  243.                       listitem = xbmcgui.ListItem( xbmc.getLocalizedString( 30500 ), iconImage=icon, thumbnailImage=thumbnail )
  244.  
  245.                       # set the title
  246.  
  247. @@ -130,7 +130,7 @@
  248.                              # create the url
  249.  
  250.                              url = "%s?category='root'&repo=%s&title=%s" % ( sys.argv[ 0 ], repr( urllib.quote_plus( repo ) ), repr( urllib.quote_plus( repo ) ), )
  251.  
  252.                              # set thumbnail
  253.  
  254. -                            thumbnail = os.path.join( os.getcwd(), "resources", "media", "svn_repo.png" )
  255.  
  256. +                            thumbnail = os.path.join( os.path.dirname(os.path.dirname(__file__)), "resources", "media", "svn_repo.png" )
  257.  
  258.                              # create our listitem, fixing title
  259.  
  260.                              listitem = xbmcgui.ListItem( repo, iconImage=icon, thumbnailImage=thumbnail )
  261.  
  262.                              # set the title
  263.  
  264. diff -Naur SVN Repo Installer/installerAPI/xbmcplugin_logviewer.py SVN Repo Installer.fix/installerAPI/xbmcplugin_logviewer.py
  265. --- SVN Repo Installer/installerAPI/xbmcplugin_logviewer.py     2009-10-14 17:04:02.748858593 -0500
  266. +++ SVN Repo Installer.fix/installerAPI/xbmcplugin_logviewer.py 2009-10-14 16:08:50.712523117 -0500
  267. @@ -45,9 +45,9 @@
  268.         def fetch_changelog( self ):
  269.  
  270.                try:
  271.  
  272.                       if ( DEBUG ):
  273.  
  274. -                            base_path = os.getcwd()
  275.  
  276. +                            base_path = os.path.dirname(os.path.dirname(__file__))
  277.  
  278.                       else:
  279.  
  280. -                            base_path = os.path.join( xbmc.translatePath( "special://profile/" ), "plugin_data", "programs", os.path.basename( os.getcwd() ) )
  281.  
  282. +                            base_path = os.path.join( xbmc.translatePath( "special://profile/" ), "plugin_data", "programs", os.path.basename( __file__ ) )
  283.  
  284.                       # make path
  285.  
  286.                       if ( not os.path.isdir( base_path ) ):
  287.  
  288.                              os.makedirs( base_path )
  289.  
  290. @@ -150,14 +150,14 @@
  291.                       return parser.fetch_changelog()
  292.  
  293.  
  294.  
  295.                def getReadmePath(self):
  296.  
  297. -                     base_path = os.path.join( os.getcwd(), "resources", "language" )
  298.  
  299. +                     base_path = os.path.join( os.path.dirname(os.path.dirname(__file__)), "resources", "language" )
  300.  
  301.                       path = os.path.join( base_path, xbmc.getLanguage(), "readme.txt" )
  302.  
  303.                       if not os.path.isfile(path):
  304.  
  305.                              path = os.path.join( base_path, "English", "readme.txt" )
  306.  
  307.                              if not os.path.isfile(path):
  308.  
  309. -                                   path = os.path.join( os.getcwd(), "resources", "readme.txt" )
  310.  
  311. +                                   path = os.path.join( os.path.dirname(os.path.dirname(__file__)), "resources", "readme.txt" )
  312.  
  313.                                     if not os.path.isfile(path):
  314.  
  315. -                                          path = os.path.join( os.getcwd(), "readme.txt" )
  316.  
  317. +                                          path = os.path.join( os.path.dirname(os.path.dirname(__file__)), "readme.txt" )
  318.  
  319.                                            if not os.path.isfile(path):
  320.  
  321.                                                   path = None
  322.  
  323.                       return path
  324.  
  325. @@ -211,7 +211,7 @@
  326.                              self.close()
  327.  
  328.  
  329.  
  330.  def Main():
  331.  
  332. -       ui = GUI( "DialogScriptInfo.xml", os.getcwd(), "Default" )
  333.  
  334. +       ui = GUI( "DialogScriptInfo.xml", os.path.dirname(os.path.dirname(__file__)), "Default" )
  335.  
  336.         ui.doModal()
  337.  
  338.         del ui
  339.  
  340.  
  341.  
  342. diff -Naur SVN Repo Installer/installerAPI/xbmcplugin_update.py SVN Repo Installer.fix/installerAPI/xbmcplugin_update.py
  343. --- SVN Repo Installer/installerAPI/xbmcplugin_update.py        2009-10-14 17:04:02.748858593 -0500
  344. +++ SVN Repo Installer.fix/installerAPI/xbmcplugin_update.py    2009-10-14 00:07:30.515799946 -0500
  345. @@ -33,8 +33,8 @@
  346.  class Main:
  347.  
  348.  
  349.  
  350.         URL_BASE_SVN_SCRIPTING = "http://xbmc-scripting.googlecode.com/svn"
  351.  
  352. -       INSTALLED_ITEMS_FILENAME = os.path.join( os.getcwd(), "installed_items.dat" )
  353.  
  354. -       UPDATE_ALL_FILENAME = os.path.join( os.getcwd(), "update_all.dat" )
  355.  
  356. +       INSTALLED_ITEMS_FILENAME = os.path.join( os.path.dirname(os.path.dirname(__file__)), "installed_items.dat" )
  357.  
  358. +       UPDATE_ALL_FILENAME = os.path.join( os.path.dirname(os.path.dirname(__file__)), "update_all.dat" )
  359.  
  360.  
  361.  
  362.         def __init__( self ):
  363.  
  364.                log( "%s init!" % self.__class__ )

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

worth-right
fantasy-obligation