The branch, eden has been updated
       via  54c54ac74db8782831197a90bd77b30965e5ce6f (commit)
       via  de439c14076d6f861a6fd67941f54fdb951c92fa (commit)
      from  c171ecc1e735abb4f4b4c0f0026481a3e7d2fd01 (commit)

- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=54c54ac74db8782831197a90bd77b30965e5ce6f

commit 54c54ac74db8782831197a90bd77b30965e5ce6f
Author: Zeljko Ametovic <[email protected]>
Date:   Tue Aug 28 09:59:03 2012 +0400

    [script.web.viewer] -v 0.9.1
    
    *** 0.9.1 ***
    Added an option to getWebResult() to pass in a mechanize.Browser instance 
for WebViewer to use
    Updated mechanize
    Fixed relative URL handling
    When simple controls are enabled (ie ATV2), the parent directory (backspace 
on the keyboard) action will now exit when there are no more pages in the 
history.
    *** 0.9.0 ***
    Now on ATV2 systems, automatically detects ATV2 and sets simple controls to 
true if unset.
    *** 0.8.9 ***
    When viewing from another addon, the parent directory (backspace on the 
keyboard) action will now exit when there are no more pages in the history.
    *** 0.8.8 ***
    Handle alternate code for 'Previous Menu' action
    *** 0.8.7 ***
    Fix broken skin for image viewer

diff --git a/script.web.viewer/addon.xml b/script.web.viewer/addon.xml
index 68f092f..479eeab 100644
--- a/script.web.viewer/addon.xml
+++ b/script.web.viewer/addon.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="script.web.viewer"
        name="Web Viewer"
-       version="0.8.6"
+       version="0.9.1"
        provider-name="Rick Phillips (ruuk)">
   <requires>
     <import addon="xbmc.python" version="2.0"/>
diff --git a/script.web.viewer/changelog.txt b/script.web.viewer/changelog.txt
index f909eac..fa7dc38 100644
--- a/script.web.viewer/changelog.txt
+++ b/script.web.viewer/changelog.txt
@@ -1,6 +1,29 @@
 Web Viewer Changelog
 
-Current Version : 0.8.6
+Current Version : 0.9.1
+
+*** 0.9.1 ***
+
+Added an option to getWebResult() to pass in a mechanize.Browser instance for 
WebViewer to use
+Updated mechanize
+Fixed relative URL handling
+When simple controls are enabled (ie ATV2), the parent directory (backspace on 
the keyboard) action will now exit when there are no more pages in the history.
+
+*** 0.9.0 ***
+
+Now on ATV2 systems, automatically detects ATV2 and sets simple controls to 
true if unset.
+
+*** 0.8.9 ***
+
+When viewing from another addon, the parent directory (backspace on the 
keyboard) action will now exit when there are no more pages in the history.
+
+*** 0.8.8 ***
+
+Handle alternate code for 'Previous Menu' action
+
+*** 0.8.7 ***
+
+Fix broken skin for image viewer
 
 *** 0.8.6 ***
 
diff --git a/script.web.viewer/lib/webviewer/mechanize/_form.py 
b/script.web.viewer/lib/webviewer/mechanize/_form.py
index 02d075d..76c13b9 100644
--- a/script.web.viewer/lib/webviewer/mechanize/_form.py
+++ b/script.web.viewer/lib/webviewer/mechanize/_form.py
@@ -71,7 +71,6 @@ import urlparse
 import warnings
 
 #import _beautifulsoup
-#change for XBMC
 import BeautifulSoup as _beautifulsoup
 import _request
 
diff --git a/script.web.viewer/lib/webviewer/mechanize/_html.py 
b/script.web.viewer/lib/webviewer/mechanize/_html.py
index 60c2cb6..0e50612 100644
--- a/script.web.viewer/lib/webviewer/mechanize/_html.py
+++ b/script.web.viewer/lib/webviewer/mechanize/_html.py
@@ -16,9 +16,7 @@ import re
 import _sgmllib_copy as sgmllib
 
 #import _beautifulsoup
-#change for XBMC
 import BeautifulSoup as _beautifulsoup
-
 import _form
 from _headersutil import split_header_words, is_html as _is_html
 import _request
diff --git a/script.web.viewer/lib/webviewer/mechanize/_msiecookiejar.py 
b/script.web.viewer/lib/webviewer/mechanize/_msiecookiejar.py
index 63f1a75..8af11c0 100644
--- a/script.web.viewer/lib/webviewer/mechanize/_msiecookiejar.py
+++ b/script.web.viewer/lib/webviewer/mechanize/_msiecookiejar.py
@@ -12,10 +12,8 @@ COPYING.txt included with the distribution).
 # XXX names and comments are not great here
 
 import os, re, time, struct, logging
-
-#For Web Viewer at least on XBMC 4 Xbox
-#if os.name == "nt":
-#    import _winreg
+if os.name == "nt":
+    import _winreg
 
 from _clientcookie import FileCookieJar, CookieJar, Cookie, \
      MISSING_FILENAME_TEXT, LoadError
@@ -24,10 +22,10 @@ debug = logging.getLogger("mechanize").debug
 
 
 def regload(path, leaf):
-    key = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, path, 0, 
#@UndefinedVariable
-                          _winreg.KEY_ALL_ACCESS) #@UndefinedVariable
+    key = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, path, 0,
+                          _winreg.KEY_ALL_ACCESS)
     try:
-        value = _winreg.QueryValueEx(key, leaf)[0] #@UndefinedVariable
+        value = _winreg.QueryValueEx(key, leaf)[0]
     except WindowsError:
         value = None
     return value
diff --git a/script.web.viewer/lib/webviewer/mechanize/_util.py 
b/script.web.viewer/lib/webviewer/mechanize/_util.py
index 0a5ebb1..3a2ccbc 100644
--- a/script.web.viewer/lib/webviewer/mechanize/_util.py
+++ b/script.web.viewer/lib/webviewer/mechanize/_util.py
@@ -30,6 +30,14 @@ def reset_deprecations():
     warnings.filterwarnings("default", category=DeprecationWarning)
 
 
+def read_file(filename):
+    fh = open(filename)
+    try:
+        return fh.read()
+    finally:
+        fh.close()
+
+
 def write_file(filename, data):
     f = open(filename, "wb")
     try:
diff --git a/script.web.viewer/lib/webviewer/mechanize/_version.py 
b/script.web.viewer/lib/webviewer/mechanize/_version.py
index ab58e4d..020c113 100644
--- a/script.web.viewer/lib/webviewer/mechanize/_version.py
+++ b/script.web.viewer/lib/webviewer/mechanize/_version.py
@@ -1,2 +1,2 @@
-"0.2.4"
-__version__ = (0, 2, 4, None, None)
+"0.2.6"
+__version__ = (0, 2, 6, None, None)
diff --git a/script.web.viewer/lib/webviewer/webviewer.py 
b/script.web.viewer/lib/webviewer/webviewer.py
index f06fa51..876c55c 100644
--- a/script.web.viewer/lib/webviewer/webviewer.py
+++ b/script.web.viewer/lib/webviewer/webviewer.py
@@ -9,7 +9,7 @@ __plugin__ = 'Web Viewer'
 __author__ = 'ruuk (Rick Phillips)'
 __url__ = 'http://code.google.com/p/webviewer-xbmc/'
 __date__ = '01-19-2011'
-__version__ = '0.8.6'
+__version__ = '0.9.1'
 __addon__ = xbmcaddon.Addon(id='script.web.viewer')
 __language__ = __addon__.getLocalizedString
 
@@ -24,6 +24,7 @@ ACTION_PAGE_DOWN = 6
 ACTION_SELECT_ITEM = 7
 ACTION_HIGHLIGHT_ITEM = 8
 ACTION_PARENT_DIR = 9
+ACTION_PARENT_DIR2 = 92
 ACTION_PREVIOUS_MENU = 10
 ACTION_SHOW_INFO = 11
 ACTION_PAUSE = 12
@@ -58,6 +59,9 @@ def LOG(message):
 
 LOG('Version: ' + __version__)
 LOG('Python Version: ' + sys.version)
+ATV2 = xbmc.getCondVisibility('System.Platform.ATV2')
+if ATV2: LOG('Running on ATV2')
+
 def clearDirFiles(filepath):
        if not os.path.exists(filepath): return
        for f in os.listdir(filepath):
@@ -85,8 +89,12 @@ class WebReader:
                self.browser.addheaders = [('User-agent', 'Mozilla/3.0 
(compatible)')]
                #self.browser.addheaders = [('User-agent','Mozilla/5.0 (X11; 
Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1')]
                
+       def setBrowser(self,browser):
+               LOG('Using Alternate Browser')
+               self.browser = browser
+               
        def getWebPage(self, url, callback=None):
-               LOG(url)
+               LOG('Getting Page at URL: ' + url)
                if not callback: callback = self.fakeCallback
                resData = ResponseData(url)
                id = ''
@@ -604,9 +612,11 @@ def fullURL(baseUrl, url):
                                url =  pre.split('/', 1)[0] + url
                        else:
                                url =  pre + domain + url
-               else:
+               elif url.startswith('.'):
                        if not base.endswith('/'): base += '/'
                        url =  pre + base + url
+               else:
+                       url =  pre + domain + '/' + url
        return url
 
 class URLHistory:
@@ -817,13 +827,13 @@ class BaseWindow(ThreadWindow):
        def __init__(self, *args, **kwargs):
                self._progMessageSave = ''
                ThreadWindow.__init__(self)
-               xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs)
+               xbmcgui.WindowXMLDialog.__init__(self)
        
        def onClick(self, controlID):
                return ThreadWindow.onClick(self, controlID)
                        
        def onAction(self, action):
-               if action == ACTION_PARENT_DIR:
+               if action == ACTION_PARENT_DIR or action == ACTION_PARENT_DIR2:
                        action = ACTION_PREVIOUS_MENU
                if ThreadWindow.onAction(self, action): return
                xbmcgui.WindowXMLDialog.onAction(self, action)
@@ -849,7 +859,7 @@ class BaseWindow(ThreadWindow):
 class ImageDialog(BaseWindow, xbmcgui.WindowXMLDialog):
        def __init__(self, *args, **kwargs):
                self.image = kwargs.get('image')
-               xbmcgui.WindowXML.__init__(self, *args, **kwargs)
+               xbmcgui.WindowXML.__init__(self)
        
        def onInit(self):
                self.showImage()
@@ -864,7 +874,7 @@ class ImageDialog(BaseWindow, xbmcgui.WindowXMLDialog):
                pass
        
        def onAction(self, action):
-               if action == ACTION_PARENT_DIR:
+               if action == ACTION_PARENT_DIR or action == ACTION_PARENT_DIR2:
                        action = ACTION_PREVIOUS_MENU
                xbmcgui.WindowXMLDialog.onAction(self, action)
                
@@ -888,7 +898,7 @@ class SourceDialog(BaseWindow, xbmcgui.WindowXMLDialog):
                pass
        
        def onAction(self, action):
-               if action == ACTION_PARENT_DIR:
+               if action == ACTION_PARENT_DIR or action == ACTION_PARENT_DIR2:
                        action = ACTION_PREVIOUS_MENU
                elif action == ACTION_PAGE_UP or action == 104:
                        action = ACTION_MOVE_UP
@@ -988,7 +998,11 @@ class ViewerWindow(BaseWindow):
                self.first = True
                
                self.isBoxee = self._isBoxee()
-               self.simpleControls = __addon__.getSetting('simple_controls') 
== 'true'
+               if ATV2:
+                       if not __addon__.getSetting('simple_controls'):
+                               LOG('ATV2: Setting unset simple_controls to: 
true')
+                               __addon__.setSetting('simple_controls','true')
+               self.simpleControls = __addon__.getSetting('simple_controls') 
== 'true'                 
                self.imageReplace = 'IMG #%s: %s'
                self.page = None
                self.history = URLHistory(HistoryLocation(self.url))
@@ -1009,6 +1023,7 @@ class ViewerWindow(BaseWindow):
                self.formFocused = False
                self.lastPageSearch = ''
                self.bmManger = 
BookmarksManager(os.path.join(xbmc.translatePath(__addon__.getAddonInfo('profile')),
 'bookmarks'))
+               self.standalone = True
                BaseWindow.__init__(self, *args, **kwargs)
                
        def onInit(self):
@@ -1028,9 +1043,10 @@ class ViewerWindow(BaseWindow):
                self.getControl(310).setVisible(False)
                
        def back(self):
-               if not self.history.canGoBack(): return
+               if not self.history.canGoBack(): return False
                hloc = self.history.goBack(self.pageList.getSelectedPosition())
                self.gotoHistory(hloc)
+               return True
 
        def forward(self):
                if not self.history.canGoForward(): return
@@ -1539,10 +1555,10 @@ class ViewerWindow(BaseWindow):
                for link in self.page.links():
                        item = xbmcgui.ListItem(link.text or link.url, 
link.urlShow())
                        if link.isImage():
-                               LOG(link.fullURL())
+                               #LOG(link.fullURL())
                                item.setIconImage(link.fullURL())
                        elif link.image:
-                               LOG(link.image)
+                               #LOG(link.image)
                                item.setIconImage(link.image)
                        else:
                                item.setIconImage('webviewer-link.png')
@@ -1801,9 +1817,11 @@ class ViewerWindow(BaseWindow):
                                self.doMenu()
                                return
                        
-               if action == ACTION_PARENT_DIR or action == 
ACTION_PLAYER_REWIND:
-                       self.back()
-                       return
+               if action == ACTION_PARENT_DIR or action == ACTION_PARENT_DIR2 
or action == ACTION_PLAYER_REWIND:
+                       if not self.back() and (not self.standalone or 
self.simpleControls):
+                               action == ACTION_PREVIOUS_MENU
+                       else:
+                               return
                elif action == ACTION_PLAYER_FORWARD:
                        self.forward()
                        return
@@ -2115,7 +2133,7 @@ def doKeyboard(prompt, default='', hidden=False):
 
################################################################################
 # getWebResult
 
################################################################################
-def getWebResult(url, autoForms=[], autoClose=None, dialog=False, 
runFromSubDir=None,clearCookies=False):
+def getWebResult(url, autoForms=[], autoClose=None, dialog=False, 
runFromSubDir=None,clearCookies=False,browser=None):
        LOG('getWebResult() - STARTED')
        """Open a url and get the result
        
@@ -2148,6 +2166,7 @@ def getWebResult(url, autoForms=[], autoClose=None, 
dialog=False, runFromSubDir=
        Setting the dialog parameter to true will cause the browser to open as 
a dialog instead as a normal window.
        
        """
+       if browser: WR.setBrowser(browser)
        if clearCookies: WR.browser._ua_handlers["_cookies"].cookiejar.clear()
        if runFromSubDir: __addon__.setAddonPath(runFromSubDir)
        apath = xbmc.translatePath(__addon__.getAddonInfo('path'))
@@ -2158,6 +2177,7 @@ def getWebResult(url, autoForms=[], autoClose=None, 
dialog=False, runFromSubDir=
                w = ViewerWindowDialog("script-webviewer-page.xml" , apath, 
THEME, url=url, autoForms=autoForms, autoClose=autoClose)
        else:
                w = ViewerWindowNormal("script-webviewer-page.xml" , apath, 
THEME, url=url, autoForms=autoForms, autoClose=autoClose)
+       w.standalone = False
        w.doModal()
        if w.page:
                url = w.page.url
diff --git a/script.web.viewer/resources/language/English/strings.xml 
b/script.web.viewer/resources/language/English/strings.xml
index 876b580..214ef8c 100644
--- a/script.web.viewer/resources/language/English/strings.xml
+++ b/script.web.viewer/resources/language/English/strings.xml
@@ -4,7 +4,7 @@
     <string id="30000">General</string>
     <string id="30001">Add Submit Button If Missing</string>
     <string id="30002">Goto URL option edits current URL</string>
-    <string id="30003">Simple Controls (ie ATV2, Boxee)</string>
+    <string id="30003">Simple Controls (ie ATV2)</string>
     
     <string id="30100">Error loading page.</string>
     <string id="30101">Processing Data</string>
diff --git a/script.web.viewer/resources/settings.xml 
b/script.web.viewer/resources/settings.xml
index d5d44b5..a94e6cd 100644
--- a/script.web.viewer/resources/settings.xml
+++ b/script.web.viewer/resources/settings.xml
@@ -4,6 +4,6 @@
   <category label="30000">
     <setting id="add_missing_submit" type="bool" label="30001" default="true" 
/>
     <setting id="goto_pre_filled" type="bool" label="30002" default="false" />
-    <setting id="simple_controls" type="bool" label="30003" default="false" />
+    <setting id="simple_controls" type="bool" label="30003" />
   </category>
 </settings>
\ No newline at end of file
diff --git 
a/script.web.viewer/resources/skins/Default/720p/script-webviewer-imageviewer.xml
 
b/script.web.viewer/resources/skins/Default/720p/script-webviewer-imageviewer.xml
index 0679231..2632d9e 100644
--- 
a/script.web.viewer/resources/skins/Default/720p/script-webviewer-imageviewer.xml
+++ 
b/script.web.viewer/resources/skins/Default/720p/script-webviewer-imageviewer.xml
@@ -14,7 +14,7 @@
                                <posy>0</posy>
                                <width>1200</width>
                                <height>700</height>
-                               <texture border="40">default-panel.png</texture>
+                               <texture 
border="40">webviewer-default-panel.png</texture>
                        </control>
                        <control type="image" id="102">
                                <posx>15</posx>
@@ -29,8 +29,8 @@
                                <posy>0</posy>
                                <width>1200</width>
                                <height>700</height>
-                       <texturefocus>transparent.png</texturefocus>
-                       <texturenofocus>transparent.png</texturenofocus>
+                       <texturefocus>webviewer-transparent.png</texturefocus>
+                       
<texturenofocus>webviewer-transparent.png</texturenofocus>
                        <onclick>PreviousMenu</onclick>
                </control>
                </control>

http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=de439c14076d6f861a6fd67941f54fdb951c92fa

commit de439c14076d6f861a6fd67941f54fdb951c92fa
Author: Zeljko Ametovic <[email protected]>
Date:   Tue Aug 28 09:56:31 2012 +0400

    [script.module.urlresolver] -v1.0.2
    
    - Fixed dailymotion
    - Fixed gorillavid

diff --git a/script.module.urlresolver/addon.xml 
b/script.module.urlresolver/addon.xml
index 92be1a2..9eb3929 100644
--- a/script.module.urlresolver/addon.xml
+++ b/script.module.urlresolver/addon.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="script.module.urlresolver" 
             name="urlresolver" 
-            version="1.0.1" 
-            provider-name="t0mm0 (inspired by unbehagan, anarchintosh)">
+            version="1.0.2" 
+            provider-name="XBMCHub.com">
   <requires>
     <import addon="xbmc.python" version="2.0" />
     <import addon="script.module.t0mm0.common" version="1.0.0"/>
diff --git a/script.module.urlresolver/changelog.txt 
b/script.module.urlresolver/changelog.txt
index f540c23..db79802 100644
--- a/script.module.urlresolver/changelog.txt
+++ b/script.module.urlresolver/changelog.txt
@@ -1,2 +1,6 @@
+[B]Version 1.0.2[/B]
+- Fixed dailymotion
+- Fixed gorillavid
+
 [B]Version 1.0.0[/B]
 - Initial Release.
diff --git a/script.module.urlresolver/lib/urlresolver/plugins/dailymotion.py 
b/script.module.urlresolver/lib/urlresolver/plugins/dailymotion.py
index f5ee820..0c5994f 100644
--- a/script.module.urlresolver/lib/urlresolver/plugins/dailymotion.py
+++ b/script.module.urlresolver/lib/urlresolver/plugins/dailymotion.py
@@ -42,7 +42,7 @@ class DailymotionResolver(Plugin, UrlResolver, 
PluginSettings):
             common.addon.log_error(self.name + '- got http error %d fetching 
%s' %
                                    (e.code, web_url))
             return False
-        sequence = re.compile('"sequence",  "(.+?)"').findall(link)
+        sequence = re.compile('"sequence":"(.+?)"').findall(link)
         newseqeunce = 
urllib.unquote(sequence[0]).decode('utf8').replace('\\/', '/')
         imgSrc = re.compile('og:image" content="(.+?)"').findall(link)
         if(len(imgSrc) == 0):
diff --git a/script.module.urlresolver/lib/urlresolver/plugins/gorillavid.py 
b/script.module.urlresolver/lib/urlresolver/plugins/gorillavid.py
index 3d5e9f9..331bbe5 100644
--- a/script.module.urlresolver/lib/urlresolver/plugins/gorillavid.py
+++ b/script.module.urlresolver/lib/urlresolver/plugins/gorillavid.py
@@ -36,7 +36,7 @@ class GorillavidResolver(Plugin, UrlResolver, PluginSettings):
         self.priority = int(p)

         self.net = Net()

         #e.g. http://gorillavid.com/vb80o1esx2eb

-        self.pattern = 'http://((?:www.)?gorillavid.com)/([0-9a-zA-Z]+)'

+        self.pattern = 'http://((?:www.)?gorillavid.in)/([0-9a-zA-Z]+)'

 

 

     def get_media_url(self, host, media_id):

@@ -63,7 +63,7 @@ class GorillavidResolver(Plugin, UrlResolver, PluginSettings):
             return False

 

         

-        r = re.search('{ file: "(.+?)", type:"video/flv" }', html)

+        r = re.search('file: "(.+?)"', html)

         print r

         if r:

             return r.group(1)

@@ -71,7 +71,7 @@ class GorillavidResolver(Plugin, UrlResolver, PluginSettings):
         return False

 

     def get_url(self, host, media_id):

-        return 'http://gorillavid.com/%s' % (media_id)

+        return 'http://gorillavid.in/%s' % (media_id)

 

     def get_host_and_id(self, url):

         r = re.search(self.pattern, url)


-----------------------------------------------------------------------

Summary of changes:
 script.module.urlresolver/addon.xml                |    4 +-
 script.module.urlresolver/changelog.txt            |    4 ++
 .../lib/urlresolver/plugins/dailymotion.py         |    2 +-
 .../lib/urlresolver/plugins/gorillavid.py          |    6 +-
 script.web.viewer/addon.xml                        |    2 +-
 script.web.viewer/changelog.txt                    |   25 +++++++++-
 script.web.viewer/lib/webviewer/mechanize/_form.py |    1 -
 script.web.viewer/lib/webviewer/mechanize/_html.py |    2 -
 .../lib/webviewer/mechanize/_msiecookiejar.py      |   12 ++---
 script.web.viewer/lib/webviewer/mechanize/_util.py |    8 +++
 .../lib/webviewer/mechanize/_version.py            |    4 +-
 script.web.viewer/lib/webviewer/webviewer.py       |   52 ++++++++++++++------
 .../resources/language/English/strings.xml         |    2 +-
 script.web.viewer/resources/settings.xml           |    2 +-
 .../Default/720p/script-webviewer-imageviewer.xml  |    6 +-
 15 files changed, 91 insertions(+), 41 deletions(-)


hooks/post-receive
-- 
Scripts

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to