From: Nick H. <nic...@ho...> - 2011-02-16 15:20:33
|
There are quite a few places where we use: from xml.sax.saxutils import escape There is also the quoteattr utility in the same module which may be more appropriate. Nick. Gerald Britton wrote: > Pity we can't use Python 3.2, which has: > > html¶ > A new html module was introduced with only a single function, > escape(), which is used for escaping reserved characters from HTML > markup: > > >>>> import html >>>> html.escape('x > 2 && x < 7') >>>> > 'x > 2 && x < 7' > > On Wed, Feb 16, 2011 at 7:27 AM, Doug Blank <dou...@gm...> wrote: > >> On Wed, Feb 16, 2011 at 4:56 AM, Benny Malengier >> <ben...@gm...> wrote: >> >>> You should redefine such a simple function, or move it to plugins/lib/ >>> There is no dependence on narweb, just on a simple function. >>> This function is probably already defined in the html docgen. >>> >>> If you need a plugins/lib/ plugin, you can list it as a dependency, as Doug >>> made a hook for that. You should ask him for that however, as I never used >>> it. >>> >> In your gpr file, you can have a line like: >> >> depends_on = ["libwebconnect"] >> >> which is a list of id's from other gpr files. This example will ensure >> that libwebconnect is loaded before your plugin. If it can't be found, >> or you have a cycle, then your plugin won't be loaded. >> >> If it is a common function, perhaps libhtml is the right place to put >> it, and you can put a depends_on on that. >> >> -Doug >> >> >>> Benny >>> >>> 2011/2/16 Rob Healey <rob...@gm...> >>> >>>> Greetings: >>>> >>>> Is it possible for me to import something in from the normal svn plugins >>>> into my gramps-addons plugin??? >>>> >>>> Example: >>>> >>>> ImageMetadataGramplet-- >>>> src/plugins/webreport/NarrativeWeb.py >>>> >>>> from NarrativeWeb import html_escape as html_escape >>>> >>>> Sincerely yours, >>>> Rob G. Healey >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: >>>> Pinpoint memory and threading errors before they happen. >>>> Find and fix more than 250 security defects in the development cycle. >>>> Locate bottlenecks in serial and parallel code that limit performance. >>>> http://p.sf.net/sfu/intel-dev2devfeb >>>> _______________________________________________ >>>> Gramps-devel mailing list >>>> Gra...@li... >>>> https://lists.sourceforge.net/lists/listinfo/gramps-devel >>>> >>>> >>> ------------------------------------------------------------------------------ >>> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: >>> Pinpoint memory and threading errors before they happen. >>> Find and fix more than 250 security defects in the development cycle. >>> Locate bottlenecks in serial and parallel code that limit performance. >>> http://p.sf.net/sfu/intel-dev2devfeb >>> _______________________________________________ >>> Gramps-devel mailing list >>> Gra...@li... >>> https://lists.sourceforge.net/lists/listinfo/gramps-devel >>> >>> >>> >> ------------------------------------------------------------------------------ >> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: >> Pinpoint memory and threading errors before they happen. >> Find and fix more than 250 security defects in the development cycle. >> Locate bottlenecks in serial and parallel code that limit performance. >> http://p.sf.net/sfu/intel-dev2devfeb >> _______________________________________________ >> Gramps-devel mailing list >> Gra...@li... >> https://lists.sourceforge.net/lists/listinfo/gramps-devel >> >> > > > > |