[Bf-python] webbrowser module

Willian Padovani Germano wgermano at ig.com.br
Thu Jul 15 06:46:40 CEST 2004


Hi Matt,

----- Original Message -----
From: "Matt Ebb" <matt at mke3.net>
To: <bf-python at blender.org>
Sent: Wednesday, July 14, 2004 9:38 PM
Subject: [Bf-python] webbrowser module

> Hi,
>
> Just a friendly reminder, if someone could add the python webbrowser
> module to CVS, as discussed in the last meeting, I can go ahead and add
> the relevant code/scripts/etc for the Help menu.

It's not that simple.  To include a module, we need to include the modules this
module imports, and the modules those modules import and so on, except for the
cases when the imported modules are optional (are inside a "try / except"
construct) or the part of the code where they are imported is not executed in
the environment of interest.

To get out of this, the best is to follow the policy of helping win users where
there are more builtin modules and requiring Python2.3 for the other
platforms -- because in most of them it is basically already a default component
anyway.  So we can include webbrowser.py and whatever it requires for win in the
Python23.zip file that can be shipped with win Blenders.  I'll check the
dependencies for that.

BTW,  it's better to add a check to the help scripts:

import Blender
try:
  import webbrowser
except ImportError:
  Blender.Draw.PupMenu("Missing module|You need the webbrowser Python module")
else:
  # rest of the code goes here
  # ...
  # ...

or something like that, anyway.  Doing this you might already put the help
scripts in the menu.

--
Willian, wgermano at ig.com.br




More information about the Bf-python mailing list