[weboob] RFC: Unicode encoding error

Guilhem Bonnefille guilhem.bonnefille at gmail.com
Mon Nov 3 22:46:31 CET 2014


Please, consider improving the output of the "modules" subcommand in
order to add the installation state.

Here is a suggested patch for this feature.

2014-05-12 13:58 GMT+02:00 Benjamin CARTON <carton_ben at yahoo.fr>:
> Hello,
>
>>But most of all, this output is quite limited. Is there a way to
>>discover the effective capabilities of each backend? It seems that
>>most of them support the "Collection" cap, but I think that some of
>>them don't support the search. For example, when searching with the
>>arte backend, videoob return immediatly. Knowing detailed capabilities
>>can help to adapt the GUI.
>
> I think that you are searching for :
>
>  weboob-config modules ICapVideo -f json
>
> or
>
>  weboob-config info arte
>
>
>
> search method is in this case a part of ICapVideo capability but a module is
> not forced to support it. (vimeo does not)
> If a method is not supported, a NotImplementedError will be raised
>
> regards,
>
> S'il vous plaît, évitez de m'envoyer des pièces jointes au format Word,
> PowerPoint ou Excel.
> Voir http://www.gnu.org/philosophy/no-word-attachments.fr.html
> Le Dimanche 11 mai 2014 23h07, Guilhem Bonnefille
> <guilhem.bonnefille at gmail.com> a écrit :
> Hi,
>
> I'm still working on the integration of videoob in totem (and other
> grilo compatible applications). Now, I need to retrieve list of
> backends. I identified the command "videoob backends list-modules".
>
> But, when using it inside my plugin, I encounter a "bug". I can
> reproduce outside my plugin with the following command :
>
> videoob backends list-modules | cat
> Traceback (most recent call last):
> Modules list:
> [ ] arretsurimages    arretsurimages website
> [X] arte              Arte French and German TV
> [ ] canalplus        Canal Plus French TV
> [ ] cappedtv          Capped.tv demoscene website
> [ ] dailymotion      Dailymotion video streaming website
> [ ] europarl          Europarl parliamentary video streaming website
>   File "/usr/bin/videoob", line 27, in <module>
>     Videoob.run()
>   File
> "/usr/lib/python2.7/dist-packages/weboob/tools/application/console.py",
> line 201, in run
>     super(ConsoleApplication, klass).run(args)
>   File "/usr/lib/python2.7/dist-packages/weboob/tools/application/base.py",
> line 431, in run
>     sys.exit(app.main(args))
>   File
> "/usr/lib/python2.7/dist-packages/weboob/applications/videoob/videoob.py",
> line 76, in main
>     return ReplApplication.main(self, argv)
>   File "/usr/lib/python2.7/dist-packages/weboob/tools/application/repl.py",
> line 311, in main
>     ret = self.onecmd(cmd)
>   File "/usr/lib/python2.7/dist-packages/weboob/tools/application/repl.py",
> line 410, in onecmd
>     return super(ReplApplication, self).onecmd(line)
>   File "/usr/lib/python2.7/cmd.py", line 221, in onecmd
>     return func(arg)
>   File "/usr/lib/python2.7/dist-packages/weboob/tools/application/repl.py",
> line 728, in do_backends
>     print '[%s] %s%-15s%s  %s' % (loaded, self.BOLD, name, self.NC,
> info.description)
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in
> position 32: ordinal not in range(128)
>
> This can be "solved" by replacing this line with:
>                 print '[%s] %s%-15s%s  %s' % (loaded, self.BOLD,
> name, self.NC, info.description.encode('utf-8'))
>
> But I'm not sure it is the right things to do.
>
> Furthermore, I noticed the "-f json" have no impact on this output. Is
> it possible to improve this subcommand to support json output?
>
> But most of all, this output is quite limited. Is there a way to
> discover the effective capabilities of each backend? It seems that
> most of them support the "Collection" cap, but I think that some of
> them don't support the search. For example, when searching with the
> arte backend, videoob return immediatly. Knowing detailed capabilities
> can help to adapt the GUI.
>
> Best regards,
> --
> Guilhem BONNEFILLE
> -=- JID: guyou at im.apinc.org MSN: guilhem_bonnefille at hotmail.com
> -=- mailto:guilhem.bonnefille at gmail.com
> -=- http://nathguil.free.fr/
> _______________________________________________
> weboob mailing list
> weboob at lists.symlink.me
> http://lists.symlink.me/mailman/listinfo/weboob
>
>



-- 
Guilhem BONNEFILLE
-=- JID: guyou at im.apinc.org MSN: guilhem_bonnefille at hotmail.com
-=- mailto:guilhem.bonnefille at gmail.com
-=- http://nathguil.free.fr/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: commit-7a42b07
Type: application/octet-stream
Size: 952 bytes
Desc: not available
URL: <https://lists.symlink.me/pipermail/weboob/attachments/20141103/f23f04e1/attachment.obj>


More information about the weboob mailing list