[nvda-addons] Re: Working on a new addon, problems with some imports

  • From: Noelia <nrm1977@xxxxxxxxx>
  • To: nvda-addons@xxxxxxxxxxxxx
  • Date: Sat, 1 Aug 2015 01:25:11 +0200

i would prefer you mention in the readme with a link. For me is anoying to be redirected to webpages automatically during instalation. I am with a mini pc and a flexible keyboard. Hoipe you can read this properly. Thanks.

El 31/07/2015 a las 20:19, Hrvoje Katić escribió:

One more question for developers,
Since youtube_dl is using ffmpeg for video convertion to mp3, I guess that I'll not be able to share ffmpeg.exe with the addon due to license restrictions.
So what's the best way to inform users that they have to manually copy ffmpeg.exe into windows\system32 folder. Will it be enough to mention this inside the readme, or to warn the users while installing the addon and send them to a web page for downloading ffmpeg if it's not present on the system?

Lp,
Hrvoje
Web: www.hrvojekatic.com
Private Email: info@xxxxxxxxxxxxxxx

On 31.7.2015. 17:49, Angela Delicata wrote:
Wow! Cannot wait to try it!


Il 31/07/2015 17:35, Hrvoje Katić ha scritto:
Hi,
I'm finishing the addon, and I'll post the dev version soon for testing.

Lp,
Hrvoje
Web: www.hrvojekatic.com
Private Email: info@xxxxxxxxxxxxxxx

31.7.2015. u 9:43, Shaun Everiss je napisao/la:
I agree.
dvdvideosoft is fine but I'd like to be able to convert directly to mp3 the videos downloaded.



On 31/07/2015 2:02 a.m., Danijela Popović wrote:
It will be really great to have an add-on to download from YouTube!
When can we expect the dev version?

Cheers,
Danny

On 7/30/15, Noelia <nrm1977@xxxxxxxxx> wrote:
I'm happy for that. I would like to use Jamies code too, but I get
errors trying it in readFeeds add-ons, which uses xml2.
I will try to take atention to your code too.
Thanks.


El 30/07/2015 a las 14:55, Hrvoje Katić escribió:
Hello,
Thanks, it helped. Also I had to modify youtube_dl code to search for
xml2 instead of xml, but it works now. I found out that command prompt
window pops up anyway at some moments while fetching and downloading
video, but it'll close automatically when process is finished.
Now I have to finish the addon.

Lp,
Hrvoje
Web: www.hrvojekatic.com
Private Email: info@xxxxxxxxxxxxxxx

30.7.2015. u 11:39, Noelia je napisao/la:
Hi, I like your add-ons, though unfortunately now I'm not available
for revision work, but imo you have good and creative ideas.
I don't kno if this can be useful for you. But in ReadFeeds add-on I
had problems with imports and I could fix them with a "hack", adding
this to xml2/__init__.py:


import globalPluginHandler

class GlobalPlugin(globalPluginHandler.GlobalPlugin):

"""Plugin class"""

You can compare your problems with ReadFeeds removing this code of the
add-on, available in NVDA add-ons website.
Thanks.



El 30/07/2015 a las 11:26, Hrvoje Katić escribió:
Hi all,
I'm working on a new addon that will download youtube videos and save
them into chosen video or audio format automatically with a single
keystroke. It works as follows: You open a URL with a video, press
nvda+shift+y and ther URL will be autodetected and the download begins
automatically, so you can download while listening video with no need
to
paste url or switch to another window.
To achieve this, I'm using youtube_dl which works both as a single app
and a Python module. I don't wanna run it as an app, because it'll
pop-up command prompt while downloading, and also I'll not be able to
catch exceptions that may eventually happen, so I'm running it as a
Python module. Unfortunately, youtube_dl uses some python modules not
included with NVDA by default, so I copied manually all required
external modules from python27/lib into a lib subfolder inside the
globalPlugin's folder, and I added this subfolder to the sys.path
inside
the addon's __init__.py as follows:
PLUGIN_DIR = os.path.dirname(__file__)
sys.path.append(os.path.join(PLUGIN_DIR, "lib"))
import youtube_dl
del sys.path[-1]
This allowed youtube_dl to import all required modules including
urllib2, json and others, but the problem begins when it comes to
import
xml.etree.ElementTree. Here's what I get when i open log viewer:
ERROR - globalPluginHandler.listPlugins (11:06:50):
Error importing global plugin youtube
Traceback (most recent call last):
File "globalPluginHandler.pyc", line 22, in listPlugins
File
"C:\Users\pc3\AppData\Roaming\nvda\addons\Youtube\globalPlugins\youtube\__init__.py",

line 31, in <module>
File
"C:\Users\pc3\AppData\Roaming\nvda\addons\Youtube\globalPlugins\youtube\youtube_dl\__init__.py",

line 16, in <module>
File
"C:\Users\pc3\AppData\Roaming\nvda\addons\Youtube\globalPlugins\youtube\youtube_dl\options.py",

line 8, in <module>
File
"C:\Users\pc3\AppData\Roaming\nvda\addons\Youtube\globalPlugins\youtube\youtube_dl\downloader\__init__.py",

line 3, in <module>
File
"C:\Users\pc3\AppData\Roaming\nvda\addons\Youtube\globalPlugins\youtube\youtube_dl\downloader\common.py",

line 9, in <module>
File
"C:\Users\pc3\AppData\Roaming\nvda\addons\Youtube\globalPlugins\youtube\youtube_dl\utils.py",

line 32, in <module>
ImportError: No module named etree.ElementTree
So, the utils.py submodule of youtube_dl cannot find xml.etree,
although
I've double checked that xml folder is copied properly with all the
subfolders.
I tried to fix this in many ways, so I really have no more ideas on how
to get all external submodules imported properly when running the
plugin.
Thanks for any help!

----------------------------------------------------------------
NVDA add-ons: A list to discuss add-on code enhancements and for
reporting bugs.
Community addons are available from: http://addons.nvda-project.org
To send a message to the list: nvda-addons@xxxxxxxxxxxxx
To change your list settings/unsubscribe:
//www.freelists.org/list/nvda-addons
To contact list moderators: nvda-addons-moderators@xxxxxxxxxxxxx

----------------------------------------------------------------
NVDA add-ons: A list to discuss add-on code enhancements and for
reporting bugs.
Community addons are available from: http://addons.nvda-project.org
To send a message to the list: nvda-addons@xxxxxxxxxxxxx
To change your list settings/unsubscribe:
//www.freelists.org/list/nvda-addons
To contact list moderators: nvda-addons-moderators@xxxxxxxxxxxxx
----------------------------------------------------------------
NVDA add-ons: A list to discuss add-on code enhancements and for reporting
bugs.

Community addons are available from: http://addons.nvda-project.org
To send a message to the list: nvda-addons@xxxxxxxxxxxxx
To change your list settings/unsubscribe:
//www.freelists.org/list/nvda-addons
To contact list moderators: nvda-addons-moderators@xxxxxxxxxxxxx

----------------------------------------------------------------
NVDA add-ons: A list to discuss add-on code enhancements and for reporting bugs.

Community addons are available from: http://addons.nvda-project.org
To send a message to the list: nvda-addons@xxxxxxxxxxxxx
To change your list settings/unsubscribe: //www.freelists.org/list/nvda-addons
To contact list moderators: nvda-addons-moderators@xxxxxxxxxxxxx
.

----------------------------------------------------------------
NVDA add-ons: A list to discuss add-on code enhancements and for reporting bugs.
Community addons are available from: http://addons.nvda-project.org
To send a message to the list: nvda-addons@xxxxxxxxxxxxx
To change your list settings/unsubscribe: //www.freelists.org/list/nvda-addons
To contact list moderators: nvda-addons-moderators@xxxxxxxxxxxxx

----------------------------------------------------------------
NVDA add-ons: A list to discuss add-on code enhancements and for reporting bugs.
Community addons are available from: http://addons.nvda-project.org
To send a message to the list: nvda-addons@xxxxxxxxxxxxx
To change your list settings/unsubscribe: //www.freelists.org/list/nvda-addons
To contact list moderators: nvda-addons-moderators@xxxxxxxxxxxxx

----------------------------------------------------------------
NVDA add-ons: A list to discuss add-on code enhancements and for reporting bugs.
Community addons are available from: http://addons.nvda-project.org
To send a message to the list: nvda-addons@xxxxxxxxxxxxx
To change your list settings/unsubscribe: //www.freelists.org/list/nvda-addons
To contact list moderators: nvda-addons-moderators@xxxxxxxxxxxxx

----------------------------------------------------------------
NVDA add-ons: A list to discuss add-on code enhancements and for reporting bugs.
Community addons are available from: http://addons.nvda-project.org
To send a message to the list: nvda-addons@xxxxxxxxxxxxx
To change your list settings/unsubscribe: //www.freelists.org/list/nvda-addons
To contact list moderators: nvda-addons-moderators@xxxxxxxxxxxxx


----------------------------------------------------------------
NVDA add-ons: A list to discuss add-on code enhancements and for reporting bugs.
Community addons are available from: http://addons.nvda-project.org
To send a message to the list: nvda-addons@xxxxxxxxxxxxx
To change your list settings/unsubscribe:
//www.freelists.org/list/nvda-addons
To contact list moderators: nvda-addons-moderators@xxxxxxxxxxxxx

Other related posts: