The branch, dharma has been updated
via fcecec328a6d528dd2494a7c0ff949405fd7cb43 (commit)
from fca3ccdcda372128e2c33e27918fe758360949c3 (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=fcecec328a6d528dd2494a7c0ff949405fd7cb43
commit fcecec328a6d528dd2494a7c0ff949405fd7cb43
Author: amet <[email protected]>
Date: Thu May 26 10:27:42 2011 +0400
[script.gomiso] -v 1.3.0
New autostart feature
Code improvement on autostart feature (function already here but previously
commented)
Possibility to change the default Gomiso submission message
diff --git a/script.gomiso/README.md b/script.gomiso/README.md
index 9f36028..5377be3 100644
--- a/script.gomiso/README.md
+++ b/script.gomiso/README.md
@@ -18,11 +18,8 @@ Usage
-----
The XMBC plugin for gomiso updates it with what you've been watching in XBMC.
For best results, make sure you are in library mode.
- Installation instructions:
- Download the ZIP file from GitHub and rename it as
"script.gomiso.zip".
- Install it following the "System > Addons > Install from ZIP
file" process.
-
- Soon, the script should be available through the official XBMC
repository.
+ The script is available through the official XBMC repository:
+ System > Add-ons > Get add-ons > XBMC.org Add-ons > Program
Add-ons > Gomiso
After installing this plugin, sign up for an account at
http://gomiso.com. Then..
diff --git a/script.gomiso/addon.xml b/script.gomiso/addon.xml
index cd7f51b..cead6cc 100644
--- a/script.gomiso/addon.xml
+++ b/script.gomiso/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.gomiso"
name="gomiso"
- version="1.2.0"
+ version="1.3.0"
provider-name="metabaron">
<requires>
<import addon="xbmc.python" version="1.0"/>
diff --git a/script.gomiso/changelog.txt b/script.gomiso/changelog.txt
index 46e75e6..7fd8c64 100644
--- a/script.gomiso/changelog.txt
+++ b/script.gomiso/changelog.txt
@@ -1,8 +1,11 @@
-version 1.2 - Fixed the bug opening over and over again the setting page when
authentification impossible
+version 1.3.0 New autostart feature
+ Code improvement on autostart feature (function
already here but previously commented)
+ Code improvement
+ Possibility to change the default Gomiso
submission message
+version 1.2.0 Fixed the bug opening over and over again the setting page when
authentification impossible
Removed simplejson library and use the XBMC
module.
Displaying '*' instead of the plain password
-version 1.1 - Fixed the bug related to message hardcoded thanks to XBMC
mailing list
+version 1.1.0 Fixed the bug related to message hardcoded thanks to XBMC
mailing list
-Version 1.0
- - initial public release
\ No newline at end of file
+Version 1.0.0 initial public release
\ No newline at end of file
diff --git a/script.gomiso/default.py b/script.gomiso/default.py
index e9def21..b773548 100644
--- a/script.gomiso/default.py
+++ b/script.gomiso/default.py
@@ -10,7 +10,7 @@ import simplejson as json
__author__ = "Mathieu Feulvarch"
__copyright__ = "Copyright 2011, Mathieu Feulvarch "
__license__ = "GPL"
-__version__ = "1.2"
+__version__ = "1.3.0"
__maintainer__ = "Mathieu Feulvarch"
__email__ = "[email protected]"
__status__ = "Production"
@@ -20,51 +20,82 @@ __settings__ = xbmcaddon.Addon(id=__scriptID__)
__language__ = __settings__.getLocalizedString
__cwd__ = __settings__.getAddonInfo('path')
-BASE_RESOURCE_PATH = xbmc.translatePath( os.path.join( __cwd__, 'resources',
'lib' ) )
-LANGUAGE_RESOURCE_PATH = xbmc.translatePath( os.path.join( __cwd__,
'resources', 'language' ) )
+BASE_RESOURCE_PATH = xbmc.translatePath(os.path.join(__cwd__, 'resources',
'lib'))
+LANGUAGE_RESOURCE_PATH = xbmc.translatePath(os.path.join(__cwd__, 'resources',
'language'))
sys.path.append (BASE_RESOURCE_PATH)
sys.path.append (LANGUAGE_RESOURCE_PATH)
-AUTOEXEC_SCRIPT = '\nimport time\nimport
xbmc\n\ntime.sleep(5)\nxbmc.executebuiltin("XBMC.RunScript(special://home/addons/script.gomiso/default.py,-startup)")\n'
+AUTOEXEC_SCRIPT = 'xbmc.executebuiltin("XBMC.RunScript(special://home/addons/'
+ __scriptID__ + '/default.py,-startup)")\n'
AUTOEXEC_FILE = xbmc.translatePath('special://home/userdata/autoexec.py')
AUTOEXEC_FOLDER_PATH = xbmc.translatePath('special://home/userdata/')
-addon_work_folder = os.path.join(xbmc.translatePath(
"special://profile/addon_data/" ), __scriptID__)
+addon_work_folder =
os.path.join(xbmc.translatePath("special://profile/addon_data/"), __scriptID__)
tokensFile = addon_work_folder + '/tokens'
settingsFile = addon_work_folder + '/settings.xml'
#Now that we appended the directories, let's import
from gomiso import gomiso
+def deleteAutostart():
+# if os.path.exists(AUTOEXEC_FILE):
+# autoExecFile = file(AUTOEXEC_FILE, 'r')
+# fileContent = autoExecFile.readlines()
+# autoExecFile.close()
+# autoExecFile = file('AUTOEXEC_FILE', 'w')
+# for line in fileContent:
+# if not line.find('time.sleep(5) #gomiso'):
+# autoExecFile.write(line)
+# elif not line.find(AUTOEXEC_SCRIPT):
+# autoExecFile.write(line)
+# else:
+# autoExecFile.write('')
+# autoExecFile.close()
+# xbmc.log('####Done')
+ xbmc.executebuiltin("XBMC.Notification(%s, %s, %i, %s)" % ('Gomiso',
__language__(30923), 10000, __settings__.getAddonInfo("icon")))
+
def setAutostart():
bFound = False
+ timeFound = False
+ xbmcFound = False
+ sleepFound = False
if os.path.exists(AUTOEXEC_FILE):
- xbmc.log('The file exists')
autoExecFile = file(AUTOEXEC_FILE, 'r')
fileContent = autoExecFile.readlines()
autoExecFile.close()
for line in fileContent:
- if line.find('gomiso') > 0:
+ if line.find(__scriptID__) > 0:
bFound = True
- if not bFound:
- __settings__.openSettings()
- autoExecFile = file(AUTOEXEC_FILE, 'w')
- fileContent.append(AUTOEXEC_SCRIPT)
- autoExecFile.writelines(fileContent)
- autoExecFile.close()
+ elif line.find('import time') >0:
+ timeFound = True
+ elif line.find('import xbmc') > 0:
+ xbmcFound = True
+ elif line.find('time.sleep(5) #gomiso') > 0:
+ sleepFound = True
+ if not bFound:
+ autoExecFile = file(AUTOEXEC_FILE, 'w')
+ fileContent.append('\n' + AUTOEXEC_SCRIPT)
+ if not timeFound:
+ autoExecFile.writelines('\nimport time')
+ if not xbmcFound:
+ autoExecFile.writelines('\nimport xbmc')
+ if not sleepFound:
+ autoExecFile.writelines('\ntime.sleep(5)
#gomiso')
+ autoExecFile.writelines(fileContent)
+ autoExecFile.close()
else:
- xbmc.log('The file does not exist')
- __settings__.openSettings()
if os.path.exists(AUTOEXEC_FOLDER_PATH):
- xbmc.log('The directory exists')
autoExecFile = file(AUTOEXEC_FILE, 'w')
- autoExecFile.write(AUTOEXEC_SCRIPT)
+ autoExecFile.writelines('\nimport time')
+ autoExecFile.writelines('\nimport xbmc')
+ autoExecFile.writelines('\ntime.sleep(5) #gomiso')
+ autoExecFile.write('\n' + AUTOEXEC_SCRIPT)
autoExecFile.close()
else:
- xbmc.log('Need to create the directoty')
os.makedirs(AUTOEXEC_FOLDER_PATH)
- xbmc.log('Creating the file')
autoExecFile = file(AUTOEXEC_FILE, 'w')
- autoExecFile.write(AUTOEXEC_SCRIPT)
+ autoExecFile.writelines('\nimport time')
+ autoExecFile.writelines('\nimport xbmc')
+ autoExecFile.writelines('\ntime.sleep(5) #gomiso')
+ autoExecFile.write('\n' + AUTOEXEC_SCRIPT)
autoExecFile.close()
def percentageRemaining(currenttime, duration):
@@ -82,8 +113,6 @@ def percentageRemaining(currenttime, duration):
return float(0.0)
#Commented as: next XBMC version will come with new autostart features (so
need to find a way to get both together if possible for backward compatibility)
-#The following function call was tested and is fully fonctional
-#setAutostart()
#We cannot have tokens file and no settings file
if os.path.isfile(tokensFile) == True:
@@ -107,7 +136,7 @@ else:
json_result = json.loads(letsGo.getUserInfo())
xbmc.executebuiltin("XBMC.Notification(%s, %s, %i, %s)" % ('Gomiso',
json_result['user']['username'] + " " + __language__(30916), 5000,
__settings__.getAddonInfo("icon")))
- videoThreshold = int(__settings__.getSetting( "VideoThreshold" ))
+ videoThreshold = int(__settings__.getSetting("VideoThreshold"))
if videoThreshold == 0:
videoThreshold = 75
elif videoThreshold == 1:
@@ -118,12 +147,25 @@ else:
sleepTime = 10
#Did we display messages on screen when playing video?
- verboseScreen = __settings__.getSetting( "DisplayScreen" )
+ verboseScreen = __settings__.getSetting("DisplayScreen")
if (verboseScreen == 'true'):
verboseScreen = True
else:
verboseScreen = False
-
+
+ #Did we want autostart?
+ autoStart = __settings__.getSetting("Autostart")
+ if(autoStart == 'true'):
+ setAutostart()
+ else:
+ deleteAutostart()
+
+ #What display message do we want?
+ displayMessage = __language__(30919)
+ defaultSubmissionMessage =
__settings__.getSetting("DisplayDefaultMessage")
+ if(defaultSubmissionMessage == 'false'):
+ displayMessage = __settings__.getSetting("DisplayMessage")
+
#This is the main part of the program
while (not xbmc.abortRequested):
time.sleep(sleepTime)
@@ -143,9 +185,8 @@ else:
#Retrieve only one entry but
would be good to have a threshold level like if more than 20 entries, no submit
json_result =
json.loads(letsGo.findMedia(showname, 'tv', 1))
if len(json_result) != 0:
- xbmc.log('###Length: '
+ str(len(json_result)))
-
#letsGo.checking(json_result[0]['media']['id'], season, episode,
__language__(30919))
-
letsGo.checking(json_result[0]['media']['id'], season, episode, "Watched on
XBMC - Gomiso plugin")
+
+
letsGo.checking(json_result[0]['media']['id'], season, episode, displayMessage)
if verboseScreen:
xbmc.executebuiltin("XBMC.Notification(%s, %s, %i, %s)" % ('Gomiso', showname
+ ' S' + season + 'E' + episode + ' ' + __language__(30918), 5000,
__settings__.getAddonInfo("icon")))
else:
diff --git a/script.gomiso/resources/language/English/strings.xml
b/script.gomiso/resources/language/English/strings.xml
index 3488cd0..70d8aef 100644
--- a/script.gomiso/resources/language/English/strings.xml
+++ b/script.gomiso/resources/language/English/strings.xml
@@ -12,4 +12,8 @@
<string id="30919">Watched on XBMC - Gomiso plugin</string>
<string id="30920">Display submission message</string>
<string id="30921">Authentification failed</string>
+ <string id="30922">Autostart</string>
+ <string id="30923">Manually delete gomiso from autoexec.py</string>
+ <string id="30924">Submission message</string>
+ <string id="30925">Default submission message</string>
</strings>
\ No newline at end of file
diff --git a/script.gomiso/resources/language/French/strings.xml
b/script.gomiso/resources/language/French/strings.xml
index c05586e..61ca2fc 100644
--- a/script.gomiso/resources/language/French/strings.xml
+++ b/script.gomiso/resources/language/French/strings.xml
@@ -12,4 +12,8 @@
<string id="30919">Regardé sur XBMC (extension Gomiso)</string>
<string id="30920">Afficher les messages quand soumit</string>
<string id="30921">Authentification impossible</string>
+ <string id="30922">Démarrage automatique</string>
+ <string id="30923">Effacer manuellement Gomiso de autoexec.py<string>
+ <string id="30924">Message de soumission</string>
+ <string id="30925">Message de soumission par défaut</string>
</strings>
\ No newline at end of file
diff --git a/script.gomiso/resources/settings.xml
b/script.gomiso/resources/settings.xml
index fa1bdda..acf4f2d 100644
--- a/script.gomiso/resources/settings.xml
+++ b/script.gomiso/resources/settings.xml
@@ -1,10 +1,13 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>
- <setting type="lsep" label="30901" />
- <setting id="Username" type="text" label="30905" default="" />
- <setting id="Password" type="text" option="hidden" label="30906" default=""
/>
-
+ <setting type="lsep" label="30901" />
+ <setting id="Username" type="text" label="30905" default="" />
+ <setting id="Password" type="text" option="hidden" label="30906"
default="" />
+ <setting id="Autostart" type="bool" label="30922" default="false" />
+
<setting type="lsep" label="30913" />
- <setting id="NotifyOnSubmit" type="bool" label="30920" default="true" />
+ <setting id="DisplayScreen" type="bool" label="30920" default="true" />
<setting id="VideoThreshold" type="enum" label="30915" values="25%|75%"
default="1" />
+ <setting id="DisplayDefaultMessage" type="bool" label="30925"
default="true" />
+ <setting id="DisplayMessage" type="text" label="30924" default=""
visible= "eq(-1,false)" enable="eq(-1,false)"/>
</settings>
-----------------------------------------------------------------------
Summary of changes:
script.gomiso/README.md | 7 +-
script.gomiso/addon.xml | 2 +-
script.gomiso/changelog.txt | 11 ++-
script.gomiso/default.py | 97 ++++++++++++++------
.../resources/language/English/strings.xml | 4 +
.../resources/language/French/strings.xml | 4 +
script.gomiso/resources/settings.xml | 13 ++-
7 files changed, 95 insertions(+), 43 deletions(-)
hooks/post-receive
--
Scripts
------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery,
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now.
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons