The branch, gotham has been updated
       via  f133ad76078a943ef8fe77f366249eaee9418d5a (commit)
      from  f84c7cd6a213ca5b0f8045c7af3d29ff4111b20f (commit)

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

commit f133ad76078a943ef8fe77f366249eaee9418d5a
Author: sphere <sph...@dersphere.de>
Date:   Tue Jun 24 13:14:27 2014 +0200

    [script.ambibox] updated to version 1.0.3

diff --git a/script.ambibox/addon.xml b/script.ambibox/addon.xml
index be61ba9..d4929dd 100644
--- a/script.ambibox/addon.xml
+++ b/script.ambibox/addon.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="script.ambibox" name="AmbiBox" version="1.0.1" 
provider-name="AmbiBox">
+<addon id="script.ambibox" name="AmbiBox" version="1.0.3" 
provider-name="AmbiBox">
   <requires>
     <import addon="xbmc.python" version="2.14.0"/>
     <import addon="xbmc.addon" version="12.0.0"/>
@@ -15,15 +15,17 @@ This requires that the free program Ambibox is installed.
 Download here:
 http://www.ambibox.ru/en/index.php/Main_Page
 Detailed instructions:
-http://www.ambibox.ru/en/index.php/Configuring_XBMC_script
+http://wiki.xbmc.org/index.php?title=Add-on:AmbiBox
 Notice: this program will read from the windows registry to check that Ambibox 
has been installed!
 In addition, if configured to start Ambibox if not running, it will access the 
program and start it.
     </description>
-    <disclaimer lang="en">For bugs, requests or general questions visit the 
AmbiBox thread on the AdaFruit forum.</disclaimer>
+    <disclaimer lang="en">For bugs, requests or general questions visit the 
AmbiBox thread on the XBMC forums.</disclaimer>
     <platform>windx</platform>
     <source>https://github.com/AmbiBox/AmbiBox-XBMC</source>
-    
<website>http://www.ambibox.ru/en/index.php/Configuring_XBMC_script</website>
-    
<forum>http://forums.adafruit.com/viewtopic.php?f=47&amp;t=36032&amp;start=540</forum>
+    <website>http://wiki.xbmc.org/index.php?title=Add-on:AmbiBox</website>
+    <forum>http://forum.xbmc.org/showthread.php?tid=198173</forum>
     <license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license>
+    <language></language>
+    <email></email>
   </extension>
 </addon>
diff --git a/script.ambibox/ambibox.py b/script.ambibox/ambibox.py
index 21997fe..7dd94f0 100644
--- a/script.ambibox/ambibox.py
+++ b/script.ambibox/ambibox.py
@@ -26,6 +26,7 @@ class AmbiBox:
     def __init__(self, _host, _port):
         self.host = _host
         self.port = _port
+        self.connection = None
 
     def __readResult(self):  # Return last-command API answer  (call in every 
local method)
         total_data = []
diff --git a/script.ambibox/changelog.txt b/script.ambibox/changelog.txt
index 8919c36..01ecf11 100644
--- a/script.ambibox/changelog.txt
+++ b/script.ambibox/changelog.txt
@@ -1,3 +1,11 @@
+1.0.3
+Fixed bug where lights would not turn back on after using a default profile 
which is off
+Increased speed for profiles not using XBMCDirect or AR switching
+
+1.0.2
+Fixed bug where profiles were not loaded in some circumstances
+Improved sensing manual turning off lights
+
 1.0.1
 Removed checking settings on menu launch
 Increased logging for profile identification
diff --git a/script.ambibox/default.py b/script.ambibox/default.py
index dc08af1..89d52f7 100644
--- a/script.ambibox/default.py
+++ b/script.ambibox/default.py
@@ -17,6 +17,7 @@
 
 #Modules General
 
+
 import os
 import sys
 import mmap
@@ -28,6 +29,7 @@ import subprocess
 from xml.etree import ElementTree
 from operator import itemgetter
 import ctypes
+#from json import loads as jloads
 
 user32 = ctypes.windll.user32
 screenx = user32.GetSystemMetrics(0)
@@ -68,6 +70,11 @@ __resource__ = xbmc.translatePath(os.path.join(__cwd__, 
'resources', 'lib'))
 sys.path.append(__resource__)
 __usingMediaInfo__ = False
 mediax = None
+try:
+    xbmc_version = float(str(xbmc.getInfoLabel("System.BuildVersion"))[0:4])
+except ValueError:
+    xbmc_version = 13.1
+
 
 def chkMediaInfo():
     # Check if user has installed mediainfo.dll to resources/lib or has 
installed full Mediainfo package
@@ -87,8 +94,13 @@ def chkMediaInfo():
         except WindowsError:
             pass
     if __usingMediaInfo__ is True:
-        from media import *
-        mediax = Media()
+        #from media import *
+        try:
+            # import media as mediax
+            from media import Media as mediax
+        except ImportError:
+            mediax = None
+            __usingMediaInfo__ = False
 
 chkMediaInfo()
 ambibox = AmbiBox(__settings__.getSetting("host"), 
int(__settings__.getSetting("port")))
@@ -105,7 +117,7 @@ def notification(text, *silence):
     if __settings__.getSetting("notification") == 'true':
         icon = __settings__.getAddonInfo("icon")
         smallicon = icon.encode("utf-8")
-        #xbmc.executebuiltin('Notification(AmbiBox,' + text + ',1000,' + 
smallicon + ')')
+        # xbmc.executebuiltin('Notification(AmbiBox,' + text + ',1000,' + 
smallicon + ')')
         dialog = xbmcgui.Dialog()
         if silence:
             dialog.notification('Ambibox', text, smallicon, 1000, False)
@@ -127,12 +139,30 @@ def info(txt):
     xbmc.log(msg=message.encode("utf-8"), level=xbmc.LOGNOTICE)
 
 
+"""
+def getStereoscopicMode():
+    query = '{"jsonrpc": "2.0", "method": "GUI.GetProperties", "params": 
{"properties": ["stereoscopicmode"]}, "id": 1}'
+    result = xbmc.executeJSONRPC(query)
+    jsonr = jloads(result)
+    print jsonr
+    ret = 'unknown'
+    if jsonr.has_key('result'):
+        if jsonr['result'].has_key('stereoscopicmode'):
+            if jsonr['result']['stereoscopicmode'].has_key('mode'):
+                ret = 
jsonr['result']['stereoscopicmode']['mode'].encode('utf-8')
+    #"off", "split_vertical", "split_horizontal", "row_interleaved", 
"hardware_based", "anaglyph_cyan_red", "anaglyph_green_magenta", "monoscopic"
+    return ret
+"""
+
 class ProfileManager():
+    LIGHTS_ON = True
+    LIGHTS_OFF = False
+
     def __init__(self):
         self.AmbiboxRunning = False
         self.currentProfile = ""
         self._ABP = None
-        self.softoff = False
+        self.lightStatus = None
 
     @property
     def ABP(self):
@@ -152,7 +182,7 @@ class ProfileManager():
 
     @staticmethod
     def chkAmibiboxInstalled():
-        #returns number of profiles if installed, 0 if installed with no 
profiles, -1 not installed
+        # returns number of profiles if installed, 0 if installed with no 
profiles, -1 not installed
         aReg = ConnectRegistry(None, HKEY_CURRENT_USER)
         try:
             key = OpenKey(aReg, r'Software\Server IR\Backlight\Profiles')
@@ -167,7 +197,6 @@ class ProfileManager():
         CloseKey(aReg)
         return ret
 
-
     def chkAmbiboxRunning(self):
         proclist = []
         cmd = 'WMIC PROCESS get Caption,Commandline,Processid'
@@ -206,6 +235,7 @@ class ProfileManager():
         else:
             if pid is not None:
                 self.AmbiboxRunning = True
+                self.lightSwitch(self.LIGHTS_OFF)
                 return True
             else:
                 return False
@@ -233,12 +263,18 @@ class ProfileManager():
         __settings = xbmcaddon.Addon("script.ambibox")
         pcnt = self.chkAmibiboxInstalled()
         info('%s profiles found in registry' % pcnt)
+        self.chkAmbiboxRunning()
+        if self.AmbiboxRunning:
+            self.lightSwitch(self.LIGHTS_OFF)
+            self.lightStatus = self.LIGHTS_OFF
+
         if (pcnt >= 0) and (__settings.getSetting('start_ambibox')) == 'true':
-            if self.chkAmbiboxRunning() is False:
+            if self.AmbiboxRunning is False:
                 success = self.startAmbibox()
                 if not success:
                     notification(__language__('32008'))
                     info('Could not start AmbiBox executable')
+                    sys.exit()
         if pcnt == 0:
             notification(__language__('32006'))
             info('No profiles found in Ambibox')
@@ -250,9 +286,7 @@ class ProfileManager():
             if self.AmbiboxRunning:
                 self.updateprofilesettings()
                 self.chkProfileSettings()
-        self.setProfile(__settings.getSetting('default_enable'), 
__settings.getSetting('default_profile'), True)
-        if __settings.getSetting('default_enable') == 'false':
-            self.softoff = True
+        self.setProfile(__settings.getSetting('default_enable'), 
__settings.getSetting('default_profile'))
 
     @staticmethod
     def updateprofilesettings():
@@ -334,21 +368,51 @@ class ProfileManager():
         return ARProfiles
 
     def setProfile(self, enable, profile, *force):
+        """
+        If connected to AmbiBox, change the profile to profile.
+        If force = true, turn on lights regardless of state
+        @type enable: string (either 'true' or 'false')
+        @type profile: string
+        @type force: bool
+        @rtype: None
+        """
         self.currentProfile = profile
         if ambibox.connect() == 0:
             ambibox.lock()
             if enable == 'true' and profile != 'None':
                 notification(__language__(32033) % profile)
-                if (ambibox.getStatus() == "off" and self.softoff) or force:
-                    ambibox.turnOn()
                 ambibox.setProfile(profile)
-                self.softoff = False
             else:
                 notification(__language__(32032))
-                if ambibox.getStatus() != "off":
-                    self.softoff = True
+            ambibox.unlock()
+        if force or (enable == 'true' and profile != 'None'):
+            self.lightSwitch(self.LIGHTS_ON)
+        else:
+            self.lightSwitch(self.LIGHTS_OFF)
+
+    def lightSwitch(self, lightChangeState):
+        """
+        Turns lights on or off, but will not turn on if user intiated off 
state outside of program
+        Lightstate is class constant either LIGHTS_ON or LIGHTS_OFF
+        @param lightChangeState: LIGHTS_ON or LIGHTS_OFF
+        @type  lightChangeState: bool
+        @rtype: None
+        """
+        userTurnedOff = False
+        if ambibox.connect() == 0:
+            currentlightstatus = ambibox.getStatus()
+            if (self.lightStatus is self.LIGHTS_ON) and (currentlightstatus == 
'off'):
+                userTurnedOff = True
+            ambibox.lock()
+            try:
+                if (lightChangeState is self.LIGHTS_ON) and (userTurnedOff is 
False) and (XbmcMonitor.ssOn is not True):
+                    ambibox.turnOn()
+                elif lightChangeState is self.LIGHTS_OFF:
                     ambibox.turnOff()
+            except Exception:
+                pass
             ambibox.unlock()
+        self.lightStatus = lightChangeState
 
     def SetAbxProfile(self, dar, vidfmt):
         """
@@ -424,6 +488,7 @@ class CapturePlayer(xbmc.Player):
         self.reTAB = re.compile("[-. _]h?tab[-. _]", re.IGNORECASE)
         self.reSBS = re.compile("[-. _]h?sbs[-. _]", re.IGNORECASE)
         self.onPBSfired = False
+        self.xd = None
 
     def showmenu(self):
         menu = ambibox.getProfiles()
@@ -456,85 +521,169 @@ class CapturePlayer(xbmc.Player):
             pm.setProfile(__settings.getSetting("audio_enable"), 
__settings.getSetting("audio_profile"))
 
         if self.isPlayingVideo():
-            xxx = self.getPlayingFile()
-            if __usingMediaInfo__ is True:
-                infos = mediax.getInfos(xxx)
-            else:
-                infos = [0, 0, 1, 0]
-            if infos[3] == 0:
-                rc = xbmc.RenderCapture()
-                tDar = rc.getAspectRatio()
-                if tDar == 0:
-                    tDar = float(infos[0])/float(infos[1])
-                if 0.95 < tDar < 1.05:
-                    tDar = float(screenx)/float(screeny)
-                infos[3] = tDar
+            infos = [0, 0, 1, 0]
+            mi_called = False
+            xxx = ''
+            if __settings.getSetting('video_choice') == '1' or 
__settings.getSetting('directXBMC_enable') == 'true':
+                # mode = Autoswitch or XBMC_Direct
+                # Get aspect ratio
+                # First try infoLabels, then Capture, then MediaInfo. Default 
to screen dimensions.
+
+                #Info Label Method
+                vp_ar = xbmc.getInfoLabel("VideoPlayer.VideoAspect")
+                try:
+                    infos[3] = float(vp_ar)
+                except TypeError, e:
+                    infos[3] = float(0)
+
+                # Capture Method
+
+                if infos[3] == 0:
+                    rc = xbmc.RenderCapture()
+                    infos[3] = rc.getAspectRatio()
+
+                #MediaInfo Method
+
+                if ((infos[3] == 0) or (0.95 < infos[3] < 1.05)) and mediax is 
not None:
+                    xxx = self.getPlayingFile()
+                    if xxx[0:2] != 'pvr':  # Cannot use for LiveTV stream
+                        try:
+                            infos = mediax().getInfos(xxx)
+                        except Exception, e:
+                            infos = [0, 0, 1, 0]
+                        mi_called = True
+
+                if (0.95 < infos[3] < 1.05) or infos[3] == 0:  # fallback to 
screen aspect ratio
+                    infos[3] = float(screenx)/float(screeny)
+
             if __settings.getSetting('directXBMC_enable') == 'true':
+                # If using XBMCDirect, get video dimensions, some guesswork 
needed for Infolabel method
+                # May need to use guessed ratio other than 1.778 as 4K video 
becomes more prevalent
+
+                # InfoLabel Method
+                vp_res = xbmc.getInfoLabel("VideoPlayer.VideoResolution")
+                if str(vp_res).lower() == '4k':
+                    vp_res_int = 2160
+                else:
+                    try:
+                        vp_res_int = int(vp_res)
+                    except ValueError or TypeError:
+                        vp_res_int = 0
+                if vp_res_int != 0 and infos[3] != 0:
+                    if infos[3] > 1.7778:
+                        infos[0] = int(vp_res_int * 1.7778)
+                        infos[1] = int(infos[0] / infos[3])
+                    else:
+                        infos[0] = int(infos[3] * vp_res_int)
+                        infos[1] = vp_res_int
+
+                #MediaInfo Method
+                if ((infos[0] == 0) or (infos[1] == 0)) and mediax is not None:
+                    xxx = self.getPlayingFile()
+                    if xxx[0:3] != 'pvr' and not mi_called:  # Cannot use for 
LiveTV stream
+                        try:
+                            infos = mediax().getInfos(xxx)
+                        except Exception, e:
+                            infos = [0, 0, 1, 0]
+
+                if (infos[0] == 0) or (infos[1] == 0):
+                    infos[0] = screenx
+                    infos[1] = screeny
+
+                # Set quality
+
                 quality = __settings.getSetting('directXBMC_quality')
+                minq = 32
+                maxq = infos[1]
                 if quality == '0':
-                    infos[1] = 64
+                    infos[1] = minq
                 elif quality == '1':
-                    infos[1] = 256
+                    infos[1] = int(minq + ((maxq - minq)/3))
                 elif quality == '2':
-                    infos[1] = 512
+                    infos[1] = int(minq + (2*(maxq - minq)/3))
                 else:
                     if infos[1] == 0:
                         infos[1] = screeny
                 infos[0] = int(infos[1]*infos[3])
 
-            m = self.re3D.search(xxx)
-            vidfmt = ""
-            if m and __settings.getSetting('3D_enable'):
-                n = self.reTAB.search(xxx)
-                if n:
-                    vidfmt = "TAB"
+            if __settings.getSetting('3D_enable') == 'true':
+                # Get Stereoscopic Information
+                # Use infoLabels
+                #sm2 = getStereoscopicMode()
+                stereoMode = xbmc.getInfoLabel("VideoPlayer.StereoscopicMode")
+                vidfmt = ''
+                if stereoMode == 'top_bottom':
+                    vidfmt = 'TAB'
+                elif stereoMode == 'left_right':
+                    vidfmt = 'SBS'
                 else:
-                    n = self.reSBS.search(xxx)
-                    if n:
-                        vidfmt = "SBS"
+                    if xxx == '':
+                        xxx = self.getPlayingFile()
+                    m = self.re3D.search(xxx)
+                    if m and __settings.getSetting('3D_enable'):
+                        n = self.reTAB.search(xxx)
+                        if n:
+                            vidfmt = "TAB"
+                        else:
+                            n = self.reSBS.search(xxx)
+                            if n:
+                                vidfmt = "SBS"
+                            else:
+                                info("Error in 3D filename - using default 
settings")
+                                main().pm.setProfile('true', 
__settings.getSetting("video_profile"))
                     else:
-                        info("Error in 3D filename - using default settings")
-                        main().pm.setProfile('true', 
__settings.getSetting("video_profile"))
+                        vidfmt = "Normal"
             else:
                 vidfmt = "Normal"
 
+            # Get video mode from settings
+
             videomode = __settings.getSetting("video_choice")
             try:
                 videomode = int(videomode)
             except (ValueError, TypeError):
                 videomode = 2
 
-            if videomode == 0:    #Use Default Video Profile
+            if videomode == 0:    # Use Default Video Profile
+                info('Using default video profile')
                 pm.setProfile('true', __settings.getSetting("video_profile"))
-            elif videomode == 1:  #Autoswitch
+            elif videomode == 1:  # Autoswitch
                 DAR = infos[3]
                 if DAR != 0:
                     pm.SetAbxProfile(DAR, vidfmt)
+                    info('Autoswitch on AR')
                 else:
                     info("Error retrieving DAR from video file")
-            elif videomode == 2:   #Show menu
+            elif videomode == 2:   # Show menu
                 self.showmenu()
-            elif videomode == 3:   #Turn off
-                ambibox.lock()
-                ambibox.turnOff()
-                ambibox.unlock()
-
-            if __settings.getSetting("directXBMC_enable") == 'true':   #Added
-                xd = XBMCDirect(infos, self)
-                xd.run()
-                xd.close()
+                info('Using menu for profile pick')
+            elif videomode == 3:   # Turn off
+                info('User set lights off for video')
+                pm.lightSwitch(pm.LIGHTS_OFF)
+
+        # Start separate thread for XBMC Capture
+
+            if __settings.getSetting("directXBMC_enable") == 'true':
+                if self.xd is not None:
+                    self.xd.close()
+                    self.xd = None
+                self.xd = XBMCDirect(infos, self)
+                self.xd.run()
+                # if self.xd is not None:
+                #     self.xd.close()
 
     def onPlayBackEnded(self):
         if ambibox.connect() == 0:
             __settings = xbmcaddon.Addon("script.ambibox")
             pm.setProfile(__settings.getSetting("default_enable"), 
__settings.getSetting("default_profile"))
+            if self.xd is not None:
+                self.xd.close()
+            if self.xd is not None:
+                self.xd = None
         self.onPBSfired = False
 
     def onPlayBackStopped(self):
-        if ambibox.connect() == 0:
-            __settings = xbmcaddon.Addon("script.ambibox")
-            pm.setProfile(__settings.getSetting("default_enable"), 
__settings.getSetting("default_profile"))
-        self.onPBSfired = False
+        self.onPlayBackEnded()
 
     def close(self):
         if ambibox.connect() == 0:
@@ -545,35 +694,30 @@ class CapturePlayer(xbmc.Player):
 
 
 class XbmcMonitor(xbmc.Monitor):
+    ssOn = False
+    lightsWereOff = None
 
     def __init__(self):
         xbmc.Monitor.__init__(self)
-        self.AbxAlreadyOff = False
+        self.ssOn = False
 
     def onScreensaverDeactivated(self):
-        self.setScreensaver(False)
+        self.ssOn = False
+        if self.lightsWereOff is not True:
+            pm.lightSwitch(pm.LIGHTS_ON)
 
     def onScreensaverActivated(self):
-        self.setScreensaver(True)
-
-    def setScreensaver(self, enabled):
+        self.ssOn = True
+        __settings = xbmcaddon.Addon("script.ambibox")
         if ambibox.connect() == 0:
-            __settings = xbmcaddon.Addon("script.ambibox")
-            ambibox.lock()
-            if __settings.getSetting("disable_on_screensaver") and enabled:
-                notification(__language__(32032), False)
-                if ambibox.getStatus() == "off":
-                    self.AbxAlreadyOff = True
-                else:
-                    self.AbxAlreadyOff = False
-                ambibox.turnOff()
+            if ambibox.getStatus() == 'off':
+                self.lightsWereOff = True
+            elif __settings.getSetting("disable_on_screensaver"):
+                notification(__language__(32032), True)  # silent notification
+                pm.lightSwitch(pm.LIGHTS_OFF)
+                self.lightsWereOff = False
             else:
-                profile = pm.currentProfile
-                notification(__language__(32033) % profile)
-                if not self.AbxAlreadyOff:
-                    ambibox.turnOn()
-                pm.setProfile('true', profile)
-            ambibox.unlock()
+                self.lightsWereOff = False
 
     def onSettingsChanged(self):
         __settings = xbmcaddon.Addon("script.ambibox")
@@ -617,7 +761,7 @@ class XBMCDirect (threading.Thread):
             inimap = []
             try:
                 self.player.inDataMap = mmap.mmap(0, width * height * 4 + 11, 
'AmbiBox_XBMC_SharedMemory', mmap.ACCESS_WRITE)
-            except Exception, e:
+            except Exception:
                 pass
             # get one frame to get length
             aax = None
@@ -672,7 +816,7 @@ class XBMCDirect (threading.Thread):
                         newlen = len(image)
                         self.player.inDataMap.seek(0)
                         seeked = self.player.inDataMap.read_byte()
-                        if ord(seeked) == 248:  #check that XBMC Direct is 
running
+                        if ord(seeked) == 248:  # check that XBMC Direct is 
running
                             if newlen != length:
                                 length = newlen
                                 inimapnew = inimap[0:6]
@@ -685,6 +829,9 @@ class XBMCDirect (threading.Thread):
                             self.player.inDataMap[11:(11 + length)] = 
str(image)
                             # write first byte to indicate we finished writing 
the data
                             self.player.inDataMap[0] = (chr(240))
+                            if xbmc.abortRequested:
+                                return
+                            xbmc.sleep(20)
                 self.player.inDataMap.close()
                 self.player.inDataMap = None
             else:
@@ -695,9 +842,8 @@ class XBMCDirect (threading.Thread):
 
 
 def main():
-
-    pm.start()
     monitor = XbmcMonitor()
+    pm.start()
     if ambibox.connect() == 0:
         notification(__language__(32030))
         info('Started - ver %s' % __version__)
@@ -719,9 +865,10 @@ def main():
         else:
             # This is to get around a bug where onPlayBackStarted is not fired 
for external players present
             # in releases up to Gotham 13.1
-            if player.isPlayingVideo() and not player.onPBSfired:
-                info('Firing missed onPlayBackStarted event')
-                player.onPlayBackStarted()
+            if xbmc_version < 13.11:
+                if player.isPlayingVideo() and not player.onPBSfired:
+                    info('Firing missed onPlayBackStarted event')
+                    player.onPlayBackStarted()
             xbmc.sleep(100)
 
     pm.close()
diff --git a/script.ambibox/downloadbox.py b/script.ambibox/downloadbox.py
index 71a222a..7b880e9 100644
--- a/script.ambibox/downloadbox.py
+++ b/script.ambibox/downloadbox.py
@@ -67,16 +67,16 @@ else:
         pass
 
 if __usingMediaInfo__ is True:
-    dialog = xbmcgui.Dialog()
-    dialog.ok(__language__(32040), __language__(32062))
-    del dialog
+    mdialog = xbmcgui.Dialog()
+    mdialog.ok(__language__(32040), __language__(32062))
+    del mdialog
     sys.exit()
 
 
 def main():
-    dialog = xbmcgui.Dialog()
-    if dialog.yesno(__language__(32040), __language__(32063)):
-        del dialog
+    ddialog = xbmcgui.Dialog()
+    if ddialog.yesno(__language__(32040), __language__(32063)):
+        del ddialog
         
downloadfile("https://github.com/AmbiBox/AmbiBox-XBMC/releases/download/pre-mediainfo/mediainfo.dll";)
 
 
@@ -103,21 +103,21 @@ def downloadfile(url):
             state = int(file_size_dl * 100. / file_size)
             mprogress.update(state)
         if mprogress.iscanceled():
-            dialog = xbmcgui.Dialog()
-            dialog.ok('', __language__(32066))
+            ddialog = xbmcgui.Dialog()
+            ddialog.ok('', __language__(32066))
             sys.exit()
         mprogress.close()
         f.close()
         del u
-    except Exception, e:
+    except:
         try:
             mprogress.close()
             f.close()
             del u
         except:
             pass
-        dialog = xbmcgui.Dialog()
-        dialog.ok('', __language__(32065))
+        ddialog = xbmcgui.Dialog()
+        ddialog.ok('', __language__(32065))
         if xbmcvfs.exists(fullfn):
             try:
                 xbmcvfs.delete(fullfn)
@@ -126,11 +126,11 @@ def downloadfile(url):
         sys.exit()
     success = checkhash(fullfn)
     if success:
-        dialog = xbmcgui.Dialog()
-        dialog.ok('', __language__(32067))
+        ddialog = xbmcgui.Dialog()
+        ddialog.ok('', __language__(32067))
     else:
-        dialog = xbmcgui.Dialog()
-        dialog.ok('', __language__(32065))
+        ddialog = xbmcgui.Dialog()
+        ddialog.ok('', __language__(32065))
         if xbmcvfs.exists(fullfn):
             try:
                 xbmcvfs.delete(fullfn)
diff --git a/script.ambibox/icon.png b/script.ambibox/icon.png
index 6b24174..2377262 100644
Binary files a/script.ambibox/icon.png and b/script.ambibox/icon.png differ
diff --git a/script.ambibox/resources/language/English/strings.po 
b/script.ambibox/resources/language/English/strings.po
index 0f585e0..95e5529 100644
--- a/script.ambibox/resources/language/English/strings.po
+++ b/script.ambibox/resources/language/English/strings.po
@@ -13,7 +13,7 @@ msgstr ""
 "Language: en\n"
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
 
-#Add-on messages id=32001 to 32067
+#Add-on messages id=#32001 to #32067
 
 msgctxt "#32001"
 msgid "General"
diff --git a/script.ambibox/resources/language/Russian/strings.po 
b/script.ambibox/resources/language/Russian/strings.po
index 0ec8538..beca016 100644
--- a/script.ambibox/resources/language/Russian/strings.po
+++ b/script.ambibox/resources/language/Russian/strings.po
@@ -13,7 +13,7 @@ msgstr ""
 "Language: ru\n"
 "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && 
n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
 
-#Add-on messages id=32001 to 32067
+#Add-on messages id=#32001 to #32067
 
 msgctxt "#32001"
 msgid "General"
diff --git a/script.ambibox/resources/lib/media.py 
b/script.ambibox/resources/lib/media.py
index 1620674..c117940 100644
--- a/script.ambibox/resources/lib/media.py
+++ b/script.ambibox/resources/lib/media.py
@@ -34,8 +34,8 @@ class Media:
     def __init__(self):
         self.mi = MediaInfo()
 
-    def getInfos(self, file):
-        nfile = self.smbToUNC(file)
+    def getInfos(self, mfile):
+        nfile = self.smbToUNC(mfile)
         self.mi.Open(nfile)
         width = self.mi.Get(Stream.Video, 0, "Width")
         height = self.mi.Get(Stream.Video, 0, "Height")
@@ -59,7 +59,7 @@ class Media:
         testFile = smbFile[0:3]
         newFile = ""
         if testFile == "smb":
-            for i in xrange(0,len(smbFile)):
+            for i in xrange(0, len(smbFile)):
                 if smbFile[i] == "/":
                     newFile += "\\"
                 else:
diff --git a/script.ambibox/resources/lib/mediainfodll.py 
b/script.ambibox/resources/lib/mediainfodll.py
index 40a5e1f..dd4e9ab 100644
--- a/script.ambibox/resources/lib/mediainfodll.py
+++ b/script.ambibox/resources/lib/mediainfodll.py
@@ -16,6 +16,8 @@
 # Python 3 update by Jerome Martinez
 #
 # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
+#
+#
 
 import os
 import xbmcaddon
diff --git a/script.ambibox/service.py b/script.ambibox/service.py
index fa15873..6940e09 100644
--- a/script.ambibox/service.py
+++ b/script.ambibox/service.py
@@ -15,14 +15,11 @@
 # *  http://www.gnu.org/copyleft/gpl.html
 # *#Modules General
 from ambibox import AmbiBox
-import os
-import sys
-from sys import argv
 
 # Modules XBMC
-import xbmc, xbmcgui, xbmcaddon
+import xbmcgui, xbmcaddon
 
-__settings__ = xbmcaddon.Addon( "script.ambibox" )
+__settings__ = xbmcaddon.Addon("script.ambibox")
 __language__ = __settings__.getLocalizedString
 
#########################################################################################################
 ## BEGIN
diff --git a/script.ambibox/update.py b/script.ambibox/update.py
index 0a21e3b..9a5f3c5 100644
--- a/script.ambibox/update.py
+++ b/script.ambibox/update.py
@@ -31,7 +31,7 @@ __scriptname__ = __addon__.getAddonInfo('name')
 
 sys.path.append(__resource__)
 __settingsdir__ = xbmc.translatePath(os.path.join(__cwd__, 'resources'))
-ambibox = ambibox.AmbiBox(__settings__.getSetting("host"), 
int(__settings__.getSetting("port")))
+mambibox = ambibox.AmbiBox(__settings__.getSetting("host"), 
int(__settings__.getSetting("port")))
 
 
 def info(msg):
@@ -48,10 +48,10 @@ def notification(text):
 
 
 def updateprofilesettings():
-    global ambibox
+    global mambibox
     pstrl = []
-    if ambibox.connect() == 0:
-        pfls = ambibox.getProfiles()
+    if mambibox.connect() == 0:
+        pfls = mambibox.getProfiles()
         defpfl = "None"
         pstrl.append('None')
         pstrl.append('|')
@@ -76,10 +76,10 @@ def updateprofilesettings():
 
 
 def chkProfileSettings():
-    global ambibox
-    if ambibox.connect() == 0:
+    global mambibox
+    if mambibox.connect() == 0:
         __settings = xbmcaddon.Addon("script.ambibox")
-        pfls = ambibox.getProfiles()
+        pfls = mambibox.getProfiles()
         sets2chk = ['default_profile', 'audio_profile', 'video_profile']
         vidfmts = ['2D', '3DS', '3DT']
         ars = ['43', '32', '169', '185', '22', '24']

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

Summary of changes:
 script.ambibox/addon.xml                           |   12 +-
 script.ambibox/ambibox.py                          |    1 +
 script.ambibox/changelog.txt                       |    8 +
 script.ambibox/default.py                          |  317 ++++++++++++++------
 script.ambibox/downloadbox.py                      |   30 +-
 script.ambibox/icon.png                            |  Bin 23503 -> 36971 bytes
 .../resources/language/English/strings.po          |    2 +-
 .../resources/language/Russian/strings.po          |    2 +-
 script.ambibox/resources/lib/media.py              |    6 +-
 script.ambibox/resources/lib/mediainfodll.py       |    2 +
 script.ambibox/service.py                          |    7 +-
 script.ambibox/update.py                           |   14 +-
 12 files changed, 279 insertions(+), 122 deletions(-)


hooks/post-receive
-- 
Scripts

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Xbmc-addons mailing list
Xbmc-addons@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to