The branch, frodo has been updated
       via  8e029aa6561e4a9521318252523fa92bbe7b90cb (commit)
      from  87c10567554e3c3aed7ab8fface7a342ddb5dab4 (commit)

- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=8e029aa6561e4a9521318252523fa92bbe7b90cb

commit 8e029aa6561e4a9521318252523fa92bbe7b90cb
Author: beenje <[email protected]>
Date:   Thu Jan 2 23:16:04 2014 +0100

    [plugin.video.arretsurimages] updated to version 2.3.7

diff --git a/plugin.video.arretsurimages/addon.py 
b/plugin.video.arretsurimages/addon.py
index 46492f8..efd64e5 100644
--- a/plugin.video.arretsurimages/addon.py
+++ b/plugin.video.arretsurimages/addon.py
@@ -19,7 +19,7 @@
 # http://www.gnu.org/copyleft/gpl.html
 
 import sys
-from xbmcswift import xbmcgui
+from xbmcswift2 import xbmcgui
 from collections import deque
 from SimpleDownloader import SimpleDownloader
 import resources.lib.scraper as scraper
@@ -33,6 +33,7 @@ URL = {'toutesLesEmissions': 
'http://www.arretsurimages.net/emissions.php?',
        'auxSources': URLEMISSION % 4,
        'auProchainEpisode': URLEMISSION % 5,
        '14h42': URLEMISSION % 6,
+       'CPQJ': URLEMISSION % 7,
       }
 SORTMETHOD = ['date_publication', 'nb_vues', 'nb_comments']
 BESTOF_SORTMETHOD = ['recent', 'visited', 'commented', 'rated']
@@ -43,8 +44,8 @@ def login():
     """Login or exit if it fails"""
     # Only available with a subscription
     # Check if username and password have been set
-    username = plugin.get_setting('username')
-    password = plugin.get_setting('password')
+    username = plugin.get_setting('username', unicode)
+    password = plugin.get_setting('password', unicode)
     if not username or not password:
         xbmcgui.Dialog().ok(plugin.get_string(30050), 
plugin.get_string(30051), plugin.get_string(30052))
         sys.exit(0)
@@ -58,17 +59,17 @@ def login():
 @plugin.route('/')
 def index():
     """Default view"""
-    quick_access = plugin.get_setting('quickAccess')
-    if quick_access == 'true':
+    quick_access = plugin.get_setting('quickAccess', bool)
+    if quick_access:
         # Jump directly to 'toutesLesEmissions'
         login()
         return show_programs('toutesLesEmissions', '1')
     items = [
-        {'label': plugin.get_string(30010), 'url': 
plugin.url_for('emissions')},
-        {'label': plugin.get_string(30011), 'url': plugin.url_for('bestof', 
page='1')},
-        {'label': plugin.get_string(30012), 'url': plugin.url_for('settings')},
+        {'label': plugin.get_string(30010), 'path': 
plugin.url_for('emissions')},
+        {'label': plugin.get_string(30011), 'path': plugin.url_for('bestof', 
page='1')},
+        {'label': plugin.get_string(30012), 'path': 
plugin.url_for('settings')},
     ]
-    return plugin.add_items(items)
+    return plugin.finish(items)
 
 
 @plugin.route('/emissions/')
@@ -77,46 +78,49 @@ def emissions():
     login()
     items = [
         {'label': 'Toutes les émissions',
-         'url': plugin.url_for('show_programs', label='toutesLesEmissions', 
page='1'),
-         'is_folder': True},
+         'path': plugin.url_for('show_programs', label='toutesLesEmissions', 
page='1'),
+        },
         {'label': '@rrêt sur images',
-         'url': plugin.url_for('show_programs', label='arretSurImages', 
page='1'),
+         'path': plugin.url_for('show_programs', label='arretSurImages', 
page='1'),
          'info': {'Plot':plugin.get_string(30031)},
-         'is_folder': True},
+        },
         {'label': 'D@ns le texte',
-         'url': plugin.url_for('show_programs', label='dansLeTexte', page='1'),
+         'path': plugin.url_for('show_programs', label='dansLeTexte', 
page='1'),
          'info': {'Plot': plugin.get_string(30033)},
-         'is_folder': True},
+        },
+        {'label': '14:42',
+         'path': plugin.url_for('show_programs', label='14h42', page='1'),
+         'info': {'Plot': plugin.get_string(30036)},
+        },
+        {'label': "C'est p@s qu'un jeu",
+         'path': plugin.url_for('show_programs', label='CPQJ', page='1'),
+         'info': {'Plot': plugin.get_string(30037)},
+        },
         {'label': '@ux sources',
-         'url': plugin.url_for('show_programs', label='auxSources', page='1'),
+         'path': plugin.url_for('show_programs', label='auxSources', page='1'),
          'info': {'Plot': plugin.get_string(30034)},
-         'is_folder': True},
+        },
         {'label': '@u Prochain Episode',
-         'url': plugin.url_for('show_programs', label='auProchainEpisode', 
page='1'),
+         'path': plugin.url_for('show_programs', label='auProchainEpisode', 
page='1'),
          'info': {'Plot': plugin.get_string(30035)},
-         'is_folder': True},
-        {'label': '14:42',
-         'url': plugin.url_for('show_programs', label='14h42', page='1'),
-         'info': {'Plot': plugin.get_string(30036)},
-         'is_folder': True},
+        },
         {'label': 'Ligne j@une',
-         'url': plugin.url_for('show_programs', label='ligneJaune', page='1'),
+         'path': plugin.url_for('show_programs', label='ligneJaune', page='1'),
          'info': {'Plot': plugin.get_string(30032)},
-         'is_folder': True}
+        }
     ]
-    return plugin.add_items(items)
+    return plugin.finish(items)
 
 
 @plugin.route('/bestof/<page>')
 def bestof(page):
     """Display ASI BestOf videos"""
     # No subscription required
-    sort_method = 
BESTOF_SORTMETHOD[int(plugin.get_setting('bestOfSortMethod'))]
+    sort_method = BESTOF_SORTMETHOD[plugin.get_setting('bestOfSortMethod', 
int)]
     result = scraper.get_bestof_videos(page, sort_method)
     items = [{'label': video['title'],
-              'url': plugin.url_for('play_video_id', video_id=video['id']),
+              'path': plugin.url_for('play_video_id', video_id=video['id']),
               'thumbnail': video['thumbnail_url'],
-              'is_folder': False,
               'is_playable': True,
              } for video in result['list']]
     # Add navigation items (Previous / Next) if needed
@@ -124,14 +128,14 @@ def bestof(page):
     if result['has_more']:
         next_page = str(page + 1)
         items.insert(0, {'label': plugin.get_string(30020),
-                         'url': plugin.url_for('bestof',
+                         'path': plugin.url_for('bestof',
                                                page=next_page)})
     if page > 1:
         previous_page = str(page - 1)
         items.insert(0, {'label': plugin.get_string(30021),
-                         'url': plugin.url_for('bestof',
+                         'path': plugin.url_for('bestof',
                                                page=previous_page)})
-    return plugin.add_items(items, update_listing=(page != 1))
+    return plugin.finish(items, update_listing=(page != 1))
 
 
 @plugin.route('/settings/')
@@ -143,27 +147,25 @@ def settings():
 @plugin.route('/labels/<label>/<page>/')
 def show_programs(label, page):
     """Display the list of programs"""
-    sortMethod = SORTMETHOD[int(plugin.get_setting('sortMethod'))]
+    sortMethod = SORTMETHOD[plugin.get_setting('sortMethod', int)]
     programs = scraper.Programs('%sp=%s&orderby=%s' % (URL[label], page, 
sortMethod))
     entries = programs.get_programs()
-    if plugin.get_setting('displayParts') == 'true':
+    if plugin.get_setting('displayParts', bool):
         # Displayed programs are not playable
         # We will display all the parts
         items = [{'label': program['title'],
-                  'url': plugin.url_for('get_program_parts',
+                  'path': plugin.url_for('get_program_parts',
                                         url=program['url'],
                                         name=program['title'],
                                         icon=program['thumb']),
                   'thumbnail': program['thumb'],
-                  'is_folder': True,
                  } for program in entries]
     else:
         # Displayed programs are playable
         # We will try to play the main (xvid) video
         items = [{'label': program['title'],
-                  'url': plugin.url_for('play_program', url=program['url']),
+                  'path': plugin.url_for('play_program', url=program['url']),
                   'thumbnail': program['thumb'],
-                  'is_folder': False,
                   'is_playable': True,
                   'context_menu': [(plugin.get_string(30180),
                                     'XBMC.RunPlugin(%s)' %
@@ -176,20 +178,20 @@ def show_programs(label, page):
     if nav_items['next']:
         next_page = str(page + 1)
         items.insert(0, {'label': plugin.get_string(30020),
-                         'url': plugin.url_for('show_programs',
+                         'path': plugin.url_for('show_programs',
                                                label=label,
                                                page=next_page)})
     if nav_items['previous']:
         previous_page = str(page - 1)
         items.insert(0, {'label': plugin.get_string(30021),
-                         'url': plugin.url_for('show_programs',
+                         'path': plugin.url_for('show_programs',
                                                label=label,
                                                page=previous_page)})
-    return plugin.add_items(items, update_listing=(page != 1))
+    return plugin.finish(items, update_listing=(page != 1))
 
 
[email protected]('/program/<url>', mode='play', name='play_program')
[email protected]('/download_program/<url>', mode='download', 
name='download_program')
[email protected]('/program/<url>', name='play_program', options={'mode': 'play'})
[email protected]('/download_program/<url>', name='download_program', 
options={'mode': 'download'})
 def get_program(url, mode):
     """Play or download the selected program"""
     video = scraper.get_main_video(url)
@@ -216,11 +218,11 @@ def play_video(url):
 def download_video(url, title):
     """Download the video"""
     downloader = SimpleDownloader()
-    if plugin.get_setting('downloadMode') == 'true':
+    if plugin.get_setting('downloadMode', bool):
         # Ask for the path
         download_path = xbmcgui.Dialog().browse(3, plugin.get_string(30090), 
'video')
     else:
-        download_path = plugin.get_setting('downloadPath')
+        download_path = plugin.get_setting('downloadPath', unicode)
     if download_path:
         params = {'url': url, 'download_path': download_path}
         downloader.download(title, params)
@@ -234,9 +236,8 @@ def get_program_parts(url, name, icon):
     if 'url' in part:
         # Display the main video if available
         main_item = [{'label': part['title'],
-                  'url': plugin.url_for('play_video', url=part['url']),
+                  'path': plugin.url_for('play_video', url=part['url']),
                   'thumbnail': part['thumb'],
-                  'is_folder': False,
                   'is_playable': True,
                   'context_menu': [(plugin.get_string(30180),
                                     'XBMC.RunPlugin(%s)' %
@@ -249,25 +250,24 @@ def get_program_parts(url, name, icon):
         main_item = []
     # Display the remaining videos
     items = [{'label': part['title'],
-              'url': plugin.url_for('play_video_id', 
video_id=part['video_id']),
+              'path': plugin.url_for('play_video_id', 
video_id=part['video_id']),
               'thumbnail': part['thumb'],
-              'is_folder': False,
               'is_playable': True,
               'context_menu': [(plugin.get_string(30180),
                                 'XBMC.RunPlugin(%s)' %
                                     plugin.url_for('download_video_id',
                                                     
video_id=part['video_id']))],
              } for part in parts]
-    return plugin.add_items(main_item + items)
+    return plugin.finish(main_item + items)
 
 
[email protected]('/play_video_id/<video_id>', mode='play', name='play_video_id')
[email protected]('/download_video_id/<video_id>', mode='download', 
name='download_video_id')
[email protected]('/play_video_id/<video_id>', name='play_video_id', 
options={'mode': 'play'})
[email protected]('/download_video_id/<video_id>', name='download_video_id', 
options={'mode': 'download'})
 def get_video_by_id(video_id, mode):
     """Play or download the dailymotion video"""
     streams = deque(STREAMS)
     # Order the streams depending on the quality chosen
-    streams.rotate(int(plugin.get_setting('quality')) * -1)
+    streams.rotate(plugin.get_setting('quality', int) * -1)
     video = scraper.get_video_by_id(video_id, streams)
     if mode == 'play':
         return plugin.set_resolved_url(video['url'])
diff --git a/plugin.video.arretsurimages/addon.xml 
b/plugin.video.arretsurimages/addon.xml
index c4ddbae..062cb6e 100644
--- a/plugin.video.arretsurimages/addon.xml
+++ b/plugin.video.arretsurimages/addon.xml
@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="plugin.video.arretsurimages"
        name="Arrêt Sur Images"
-       version="2.3.6"
+       version="2.3.7"
        provider-name="beenje">
   <requires>
     <import addon="xbmc.python" version="2.1.0"/>
     <import addon="script.module.beautifulsoup" version="3.0.8"/>
-    <import addon="script.module.xbmcswift" version="0.2.0"/>
+    <import addon="script.module.xbmcswift2" version="2.4.0"/>
     <import addon="script.module.requests" version="1.0.4"/>
     <import addon="script.module.simple.downloader" version="0.9.2"/>
   </requires>
@@ -27,5 +27,6 @@
     <website>http://www.arretsurimages.net</website>
     <source>https://github.com/beenje/plugin.video.arretsurimages</source>
     <email>[email protected]</email>
+    <forum></forum>
   </extension>
 </addon>
diff --git a/plugin.video.arretsurimages/changelog.txt 
b/plugin.video.arretsurimages/changelog.txt
index 1c09f49..4720364 100644
--- a/plugin.video.arretsurimages/changelog.txt
+++ b/plugin.video.arretsurimages/changelog.txt
@@ -1,3 +1,8 @@
+[B]Version 2.3.7[/B]
+
+- Add new program "C'est p@s qu'un jeu"
+- Upgrade to xbmcswift2
+
 [B]Version 2.3.6[/B]
 
 - Add new program "14:42"
diff --git a/plugin.video.arretsurimages/config.py 
b/plugin.video.arretsurimages/config.py
index aa8acda..f141a4d 100644
--- a/plugin.video.arretsurimages/config.py
+++ b/plugin.video.arretsurimages/config.py
@@ -18,35 +18,8 @@
 # http://www.gnu.org/copyleft/gpl.html
 
 import os
-from xbmcswift import Plugin, xbmc, xbmcplugin
+from xbmcswift2 import Plugin, xbmc
 
-# Global variables
-PLUGIN_NAME = 'Arrêt Sur Images'
-PLUGIN_ID = 'plugin.video.arretsurimages'
-
-
-class Plugin_mod(Plugin):
-    """Plugin class modified to pass updateListing to 
xbmcplugin.endOfDirectory"""
-
-    def add_items(self, iterable, view_mode=None, update_listing=False):
-        items = []  # Keeps track of the list of tuples (url, list_item, 
is_folder) to pass to xbmcplugin.addDirectoryItems
-        urls = []  # Keeps track of the XBMC urls for all of the list items
-        for i, li_info in enumerate(iterable):
-            items.append(self._make_listitem(**li_info))
-            if self._mode in ['crawl', 'interactive', 'test']:
-                #print '[%d] %s%s%s (%s)' % (i + 1, C.blue, 
li_info.get('label'), C.end, li_info.get('url'))
-                print '[%d] %s%s%s (%s)' % (i + 1, '', li_info.get('label'), 
'', li_info.get('url'))
-                urls.append(li_info.get('url'))
-
-        if self._mode is 'xbmc':
-            if not xbmcplugin.addDirectoryItems(self.handle, items, 
len(items)):
-                raise Exception, 'problem?'
-            if view_mode:
-                xbmc.executebuiltin('Container.SetViewMode(%s)' % view_mode)
-            xbmcplugin.endOfDirectory(self.handle, 
updateListing=update_listing)
-
-        return urls
-
-plugin = Plugin_mod(PLUGIN_NAME, PLUGIN_ID, __file__)
-profile_path = xbmc.translatePath(plugin._plugin.getAddonInfo('profile'))
+plugin = Plugin('Arrêt Sur Images')
+profile_path = xbmc.translatePath(plugin.addon.getAddonInfo('profile'))
 cookie_file = os.path.join(profile_path, 'asi_cookie.pkl')
diff --git a/plugin.video.arretsurimages/resources/language/English/strings.xml 
b/plugin.video.arretsurimages/resources/language/English/strings.xml
index eec51d5..e0cf816 100644
--- a/plugin.video.arretsurimages/resources/language/English/strings.xml
+++ b/plugin.video.arretsurimages/resources/language/English/strings.xml
@@ -24,6 +24,8 @@
     <string id="30035">They write TV shows. Or produce them. Or make their 
accessories. Or are just fans. Rafik Djoumi will confess them. Episode after 
episode.</string>
     <!--14:42-->
     <string id="30036">Every second Tuesday, at 14:42, this program answers 
all questions about life, the universe, and... everything digital.</string>
+    <!--CPQJ-->
+    <string id="30037">Program that discusses topics related to video games, 
their history, their economy, their ideology. It is linked to CanardPC 
magazine.</string>
 
     <!--Errors-->
     <string id="30050">Logon Error</string>
diff --git a/plugin.video.arretsurimages/resources/language/French/strings.xml 
b/plugin.video.arretsurimages/resources/language/French/strings.xml
index 88530d8..2fbd000 100644
--- a/plugin.video.arretsurimages/resources/language/French/strings.xml
+++ b/plugin.video.arretsurimages/resources/language/French/strings.xml
@@ -24,6 +24,8 @@
     <string id="30035">Ils écrivent des séries télévisées. Ou ils les 
réalisent. Ou fabriquent leurs accessoires. Ou ils sont simplement des 
spécialistes fans. Rafik Djoumi va les confesser. Episode après 
épisode.</string>
     <!--14:42-->
     <string id="30036">Tous les deux mardis, à 14 heures 42, cette émission, 
co-produite par notre site et PCINpact, présentée par Jean-Marc Manach, 
répond à toutes les questions sur la vie, l'univers, et...le 
numérique.</string>
+    <!--CPQJ-->
+    <string id="30037">L'émission, présentée par Daniel Schneidermann avec 
la rédaction de CanardPC, débat de sujets liés aux jeux vidéo, à leur 
histoire, à leur économie, à leur idéologie. Elle est liée à des dossiers 
de CanardPC.</string>
 
     <!--Errors-->
     <string id="30050">Erreur de connexion</string>
diff --git a/plugin.video.arretsurimages/resources/lib/scraper.py 
b/plugin.video.arretsurimages/resources/lib/scraper.py
index bc53009..db6827c 100644
--- a/plugin.video.arretsurimages/resources/lib/scraper.py
+++ b/plugin.video.arretsurimages/resources/lib/scraper.py
@@ -20,7 +20,7 @@
 import re
 import pickle
 import requests
-from xbmcswift import xbmc
+from xbmcswift2 import xbmc
 from BeautifulSoup import SoupStrainer, BeautifulSoup
 import config
 

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

Summary of changes:
 plugin.video.arretsurimages/addon.py               |  106 ++++++++++----------
 plugin.video.arretsurimages/addon.xml              |    5 +-
 plugin.video.arretsurimages/changelog.txt          |    5 +
 plugin.video.arretsurimages/config.py              |   33 +------
 .../resources/language/English/strings.xml         |    2 +
 .../resources/language/French/strings.xml          |    2 +
 .../resources/lib/scraper.py                       |    2 +-
 7 files changed, 69 insertions(+), 86 deletions(-)


hooks/post-receive
-- 
Plugins

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to