PK68“×2EGG-INFO/zip-safe PK68Ý9Ÿy**EGG-INFO/SOURCES.txtsetup.py TracHierWiki.egg-info/PKG-INFO TracHierWiki.egg-info/SOURCES.txt TracHierWiki.egg-info/dependency_links.txt TracHierWiki.egg-info/entry_points.txt TracHierWiki.egg-info/top_level.txt hierwiki/__init__.py hierwiki/macros/__init__.py hierwiki/macros/parentwiki.py hierwiki/macros/subwiki.py PK68áëS22EGG-INFO/entry_points.txt[trac.plugins] hierwiki.macros = hierwiki.macros PK68“×2EGG-INFO/dependency_links.txt PK68˲sbbEGG-INFO/PKG-INFOMetadata-Version: 1.0 Name: TracHierWiki Version: 0.1-r1 Summary: Hierarchical wiki macros. Home-page: http://trac-hacks.org/wiki/HierWikiPlugin Author: Noah Kantrowitz Author-email: coderanger@yahoo.com License: BSD Description: Various things related to using the wiki in hierarchical way. Keywords: trac plugin macros wiki hierarchy Platform: UNKNOWN PK68þã¢ÝEGG-INFO/top_level.txthierwiki/macros hierwiki PKx±Ï4hierwiki/__init__.pyPK68û:M……hierwiki/__init__.pyo;ò d’Dc@sdS(N((((s5build/bdist.darwin-8.0.1-x86/egg/hierwiki/__init__.pys?sPK68û:M……hierwiki/__init__.pyc;ò d’Dc@sdS(N((((s5build/bdist.darwin-8.0.1-x86/egg/hierwiki/__init__.pys?sPK68 ‘ 0úúhierwiki/macros/subwiki.pyo;ò d’Dc@s\dkTdklZlZdklZdkZdkZdkZdefd„ƒYZ dS((s*(sIWikiMacroProviders WikiSystem(sStringIONs SubWikiMacrocBs<tZdZeeƒd„Zd„Zd„Zd„ZRS(s2 Inserts an alphabetic list of sub-wiki pages into the output. A sub-wiki page is a page that is is deeper in the hierachy than the current page. e.g. if the current page is People, the this will return a list of all wiki entries that start with "People/" Accepts a prefix string as parameter: if provided, only pages with names that start with the prefix are included in the resulting list. If this parameter is omitted, all pages are listed. This now takes the text of the first heading and displays it as the link name. ccs2|ii}|idƒo|d }n|VdS(s4Yield the name of the macro based on the class name.sMacroiûÿÿÿN(sselfs __class__s__name__snamesendswith(sselfsname((s;build/bdist.darwin-8.0.1-x86/egg/hierwiki/macros/subwiki.pys get_macross  cCsti|iƒSdS(s Return the subclass's docstring.N(sinspectsgetdocsselfs __class__(sselfsname((s;build/bdist.darwin-8.0.1-x86/egg/hierwiki/macros/subwiki.pysget_macro_descriptionscCs\|iiƒ} | iƒ}| iƒ}|iiddƒd}t }|ov|i ddƒ}|idƒ}|ddjo|d}nt|ƒd jo|d djo|d }qÃnd }|o|d |7}n|d 7}|i|ƒtƒ}|id ƒx/no'|iƒ}|t joPn|d}|o7|idƒ} t| ƒt|ƒd joqqnd|}|i|ƒx£no›|iƒ}|t joPn|d}|d }|i| |ƒ\} } }|ii i!|ƒ} |id| | fƒ|i| ƒ|id|ƒq WqW|idƒ|i#ƒSdS(Nswiki.page_namess/s's''s,isNoneisSELECT DISTINCT name FROM wiki sWHERE name LIKE '%s%%' s ORDER BY names($sselfsenvs get_db_cnxsdbscursorscssreqshdfsgetValuesprefixsNoneslevelsargssreplacessplitslenssqlsexecutesStringIOsbufswritesfetchonesrowsnameslen_namesintscsrowstexts_getinfoslinktextstitlesdescshrefswikislinksgetvalue(sselfsreqsnamesargsstextsprefixscssrowscsrowstitleslen_nameslinktextsdbslinkssqlsbufsdescslevelscursor((s;build/bdist.darwin-8.0.1-x86/egg/hierwiki/macros/subwiki.pys render_macro#sZ  $                c Csì|iƒ}|} |id|ƒ|iƒ}d}|t joI|d}t i d|ƒ}|t joti|idƒƒ} q‘nd}tƒ}|id|| fƒ|djp | |jo d} n||iƒ| fSdS(NsESELECT text from wiki where name = '%s' order by version desc limit 1sis =+\s([^=]*)=+isCreate s%s%s(sdbscursorscssnamesdescsexecutesfetchonescsrowsprefixsNonestextsressearchsmsstringsstripsgroupsStringIOstitleswritesgetvalue( sselfsdbsnamescsrowstitlestextsmsprefixscssdesc((s;build/bdist.darwin-8.0.1-x86/egg/hierwiki/macros/subwiki.pys_getinfo]s         ( s__name__s __module__s__doc__s implementssIWikiMacroProviders get_macrossget_macro_descriptions render_macros_getinfo(((s;build/bdist.darwin-8.0.1-x86/egg/hierwiki/macros/subwiki.pys SubWikiMacro s     :( s trac.cores trac.wiki.apisIWikiMacroProviders WikiSystemsStringIOsresstringsinspects Components SubWikiMacro(sstringsIWikiMacroProvidersStringIOsinspectsres SubWikiMacros WikiSystem((s;build/bdist.darwin-8.0.1-x86/egg/hierwiki/macros/subwiki.pys?s PKx±Ï4¬Ñ‡'!!hierwiki/macros/__init__.pyimport subwiki import parentwiki PK68ɘRÇD D hierwiki/macros/parentwiki.pyc;ò d’Dc@s\dkTdklZlZdklZdkZdkZdkZdefd„ƒYZ dS((s*(sIWikiMacroProviders WikiSystem(sStringIONsParentWikiMacrocBs3tZdZeeƒd„Zd„Zd„ZRS(s Inserts a link to the "parent" wiki entry. This only applies to wikis that have a "/" in their name indicating heirarchy. e.g. an entry named Java/Introduction will have a parent of Java. All other wiki entries have a parent of WikiStart. ccs2|ii}|idƒo|d }n|VdS(s4Yield the name of the macro based on the class name.sMacroiûÿÿÿN(sselfs __class__s__name__snamesendswith(sselfsname((s>build/bdist.darwin-8.0.1-x86/egg/hierwiki/macros/parentwiki.pys get_macross  cCsti|iƒSdS(s Return the subclass's docstring.N(sinspectsgetdocsselfs __class__(sselfsname((s>build/bdist.darwin-8.0.1-x86/egg/hierwiki/macros/parentwiki.pysget_macro_descriptionsc CsÚ|iiƒ}|iƒ}tƒ} t}|o|i ddƒ}n|i i ddƒd}d}tid|ƒ}|o|idƒ}n| id |iii|ƒƒ| i|ƒ| id ƒ| iƒSdS( Ns's''swiki.page_namess/s WikiStarts (\S+)/(\S+)$is s (sselfsenvs get_db_cnxsdbscursorsStringIOsbufsNonesprefixsargssreplacesreqshdfsgetValuesparentsressearchsmsgroupswriteshrefswikisgetvalue( sselfsreqsnamesargssparentsmsdbscursorsprefixsbuf((s>build/bdist.darwin-8.0.1-x86/egg/hierwiki/macros/parentwiki.pys render_macro s     (s__name__s __module__s__doc__s implementssIWikiMacroProviders get_macrossget_macro_descriptions render_macro(((s>build/bdist.darwin-8.0.1-x86/egg/hierwiki/macros/parentwiki.pysParentWikiMacro s    ( s trac.cores trac.wiki.apisIWikiMacroProviders WikiSystemsStringIOsresstringsinspects ComponentsParentWikiMacro(sstringsIWikiMacroProvidersStringIOsinspectsresParentWikiMacros WikiSystem((s>build/bdist.darwin-8.0.1-x86/egg/hierwiki/macros/parentwiki.pys?s PK68ùôøÖÖhierwiki/macros/__init__.pyo;ò d’Dc@sdkZdkZdS(N(ssubwikis parentwiki(ssubwikis parentwiki((s<build/bdist.darwin-8.0.1-x86/egg/hierwiki/macros/__init__.pys?s PK68 ‘ 0úúhierwiki/macros/subwiki.pyc;ò d’Dc@s\dkTdklZlZdklZdkZdkZdkZdefd„ƒYZ dS((s*(sIWikiMacroProviders WikiSystem(sStringIONs SubWikiMacrocBs<tZdZeeƒd„Zd„Zd„Zd„ZRS(s2 Inserts an alphabetic list of sub-wiki pages into the output. A sub-wiki page is a page that is is deeper in the hierachy than the current page. e.g. if the current page is People, the this will return a list of all wiki entries that start with "People/" Accepts a prefix string as parameter: if provided, only pages with names that start with the prefix are included in the resulting list. If this parameter is omitted, all pages are listed. This now takes the text of the first heading and displays it as the link name. ccs2|ii}|idƒo|d }n|VdS(s4Yield the name of the macro based on the class name.sMacroiûÿÿÿN(sselfs __class__s__name__snamesendswith(sselfsname((s;build/bdist.darwin-8.0.1-x86/egg/hierwiki/macros/subwiki.pys get_macross  cCsti|iƒSdS(s Return the subclass's docstring.N(sinspectsgetdocsselfs __class__(sselfsname((s;build/bdist.darwin-8.0.1-x86/egg/hierwiki/macros/subwiki.pysget_macro_descriptionscCs\|iiƒ} | iƒ}| iƒ}|iiddƒd}t }|ov|i ddƒ}|idƒ}|ddjo|d}nt|ƒd jo|d djo|d }qÃnd }|o|d |7}n|d 7}|i|ƒtƒ}|id ƒx/no'|iƒ}|t joPn|d}|o7|idƒ} t| ƒt|ƒd joqqnd|}|i|ƒx£no›|iƒ}|t joPn|d}|d }|i| |ƒ\} } }|ii i!|ƒ} |id| | fƒ|i| ƒ|id|ƒq WqW|idƒ|i#ƒSdS(Nswiki.page_namess/s's''s,isNoneisSELECT DISTINCT name FROM wiki sWHERE name LIKE '%s%%' s ORDER BY names($sselfsenvs get_db_cnxsdbscursorscssreqshdfsgetValuesprefixsNoneslevelsargssreplacessplitslenssqlsexecutesStringIOsbufswritesfetchonesrowsnameslen_namesintscsrowstexts_getinfoslinktextstitlesdescshrefswikislinksgetvalue(sselfsreqsnamesargsstextsprefixscssrowscsrowstitleslen_nameslinktextsdbslinkssqlsbufsdescslevelscursor((s;build/bdist.darwin-8.0.1-x86/egg/hierwiki/macros/subwiki.pys render_macro#sZ  $                c Csì|iƒ}|} |id|ƒ|iƒ}d}|t joI|d}t i d|ƒ}|t joti|idƒƒ} q‘nd}tƒ}|id|| fƒ|djp | |jo d} n||iƒ| fSdS(NsESELECT text from wiki where name = '%s' order by version desc limit 1sis =+\s([^=]*)=+isCreate s%s%s(sdbscursorscssnamesdescsexecutesfetchonescsrowsprefixsNonestextsressearchsmsstringsstripsgroupsStringIOstitleswritesgetvalue( sselfsdbsnamescsrowstitlestextsmsprefixscssdesc((s;build/bdist.darwin-8.0.1-x86/egg/hierwiki/macros/subwiki.pys_getinfo]s         ( s__name__s __module__s__doc__s implementssIWikiMacroProviders get_macrossget_macro_descriptions render_macros_getinfo(((s;build/bdist.darwin-8.0.1-x86/egg/hierwiki/macros/subwiki.pys SubWikiMacro s     :( s trac.cores trac.wiki.apisIWikiMacroProviders WikiSystemsStringIOsresstringsinspects Components SubWikiMacro(sstringsIWikiMacroProvidersStringIOsinspectsres SubWikiMacros WikiSystem((s;build/bdist.darwin-8.0.1-x86/egg/hierwiki/macros/subwiki.pys?s PKx±Ï4m²J••hierwiki/macros/parentwiki.py# Macros for the HierWiki plugin from trac.core import * from trac.wiki.api import IWikiMacroProvider, WikiSystem from StringIO import StringIO import re, string, inspect class ParentWikiMacro(Component): """ Inserts a link to the "parent" wiki entry. This only applies to wikis that have a "/" in their name indicating heirarchy. e.g. an entry named Java/Introduction will have a parent of Java. All other wiki entries have a parent of WikiStart. """ # TODO: Everything until render_macro can be removed once switched to be based on WikiMacroBase implements(IWikiMacroProvider) def get_macros(self): """Yield the name of the macro based on the class name.""" name = self.__class__.__name__ if name.endswith('Macro'): name = name[:-5] yield name def get_macro_description(self, name): """Return the subclass's docstring.""" return inspect.getdoc(self.__class__) def render_macro(self, req, name, args): db = self.env.get_db_cnx() cursor = db.cursor() buf = StringIO() prefix = None if args: prefix = args.replace('\'', '\'\'') else: prefix = req.hdf.getValue('wiki.page_name', '') + '/' parent = 'WikiStart' m = re.search("(\S+)/(\S+)$", prefix) if m: parent = m.group(1) buf.write('' % self.env.href.wiki(parent)) buf.write(parent) buf.write('\n') return buf.getvalue() PK68ɘRÇD D hierwiki/macros/parentwiki.pyo;ò d’Dc@s\dkTdklZlZdklZdkZdkZdkZdefd„ƒYZ dS((s*(sIWikiMacroProviders WikiSystem(sStringIONsParentWikiMacrocBs3tZdZeeƒd„Zd„Zd„ZRS(s Inserts a link to the "parent" wiki entry. This only applies to wikis that have a "/" in their name indicating heirarchy. e.g. an entry named Java/Introduction will have a parent of Java. All other wiki entries have a parent of WikiStart. ccs2|ii}|idƒo|d }n|VdS(s4Yield the name of the macro based on the class name.sMacroiûÿÿÿN(sselfs __class__s__name__snamesendswith(sselfsname((s>build/bdist.darwin-8.0.1-x86/egg/hierwiki/macros/parentwiki.pys get_macross  cCsti|iƒSdS(s Return the subclass's docstring.N(sinspectsgetdocsselfs __class__(sselfsname((s>build/bdist.darwin-8.0.1-x86/egg/hierwiki/macros/parentwiki.pysget_macro_descriptionsc CsÚ|iiƒ}|iƒ}tƒ} t}|o|i ddƒ}n|i i ddƒd}d}tid|ƒ}|o|idƒ}n| id |iii|ƒƒ| i|ƒ| id ƒ| iƒSdS( Ns's''swiki.page_namess/s WikiStarts (\S+)/(\S+)$is s (sselfsenvs get_db_cnxsdbscursorsStringIOsbufsNonesprefixsargssreplacesreqshdfsgetValuesparentsressearchsmsgroupswriteshrefswikisgetvalue( sselfsreqsnamesargssparentsmsdbscursorsprefixsbuf((s>build/bdist.darwin-8.0.1-x86/egg/hierwiki/macros/parentwiki.pys render_macro s     (s__name__s __module__s__doc__s implementssIWikiMacroProviders get_macrossget_macro_descriptions render_macro(((s>build/bdist.darwin-8.0.1-x86/egg/hierwiki/macros/parentwiki.pysParentWikiMacro s    ( s trac.cores trac.wiki.apisIWikiMacroProviders WikiSystemsStringIOsresstringsinspects ComponentsParentWikiMacro(sstringsIWikiMacroProvidersStringIOsinspectsresParentWikiMacros WikiSystem((s>build/bdist.darwin-8.0.1-x86/egg/hierwiki/macros/parentwiki.pys?s PKx±Ï44xïõööhierwiki/macros/subwiki.py# Macros for the HierWiki plugin from trac.core import * from trac.wiki.api import IWikiMacroProvider, WikiSystem from StringIO import StringIO import re, string, inspect class SubWikiMacro(Component): """ Inserts an alphabetic list of sub-wiki pages into the output. A sub-wiki page is a page that is is deeper in the hierachy than the current page. e.g. if the current page is People, the this will return a list of all wiki entries that start with "People/" Accepts a prefix string as parameter: if provided, only pages with names that start with the prefix are included in the resulting list. If this parameter is omitted, all pages are listed. This now takes the text of the first heading and displays it as the link name. """ # TODO: Everything until render_macro can be removed once switched to be based on WikiMacroBase implements(IWikiMacroProvider) def get_macros(self): """Yield the name of the macro based on the class name.""" name = self.__class__.__name__ if name.endswith('Macro'): name = name[:-5] yield name def get_macro_description(self, name): """Return the subclass's docstring.""" return inspect.getdoc(self.__class__) def render_macro(self, req, name, args): # Args seperated by commas: # prefix,level # # Page Name prefix to search for. # how many 'levels' in the hierarchy to go down. db = self.env.get_db_cnx() cursor = db.cursor() cs = db.cursor() prefix = req.hdf.getValue('wiki.page_name', '') + '/' level = None if args: args = args.replace('\'', '\'\'') args = args.split(',') if args[0] != 'None': prefix = args[0] if len(args) > 1 and args[1] != 'None': level = args[1] sql = 'SELECT DISTINCT name FROM wiki ' if prefix: sql += 'WHERE name LIKE \'%s%%\' ' % prefix sql += 'ORDER BY name' cursor.execute(sql) buf = StringIO() buf.write('') return buf.getvalue() def _getinfo(self, db, name): cs = db.cursor() desc = name # Get the latest revision only. cs.execute('SELECT text from wiki where name = \'%s\' order by version desc limit 1' % name) csrow = cs.fetchone() prefix = '' if csrow != None: text = csrow[0] m = re.search('=+\s([^=]*)=+',text) if m != None: desc = string.strip(m.group(1)) else: prefix = "Create " title = StringIO() title.write("%s%s"%(prefix, desc)) if prefix != '' or desc == name: desc = '' return (name,title.getvalue(),desc) PK68ùôøÖÖhierwiki/macros/__init__.pyc;ò d’Dc@sdkZdkZdS(N(ssubwikis parentwiki(ssubwikis parentwiki((s<build/bdist.darwin-8.0.1-x86/egg/hierwiki/macros/__init__.pys?s PK68“×2¤EGG-INFO/zip-safePK68Ý9Ÿy**¤0EGG-INFO/SOURCES.txtPK68áëS22¤ŒEGG-INFO/entry_points.txtPK68“×2¤õEGG-INFO/dependency_links.txtPK68˲sbb¤1EGG-INFO/PKG-INFOPK68þã¢Ý¤ÂEGG-INFO/top_level.txtPKx±Ï4¤hierwiki/__init__.pyPK68û:M……¤Ahierwiki/__init__.pyoPK68û:M……¤ùhierwiki/__init__.pycPK68 ‘ 0úú¤±hierwiki/macros/subwiki.pyoPKx±Ï4¬Ñ‡'!!¤ähierwiki/macros/__init__.pyPK68ɘRÇD D ¤>hierwiki/macros/parentwiki.pycPK68ùôøÖÖ¤¾"hierwiki/macros/__init__.pyoPK68 ‘ 0úú¤Î#hierwiki/macros/subwiki.pycPKx±Ï4m²J••¤6hierwiki/macros/parentwiki.pyPK68ɘRÇD D ¤Ñ<hierwiki/macros/parentwiki.pyoPKx±Ï44xïõöö¤QGhierwiki/macros/subwiki.pyPK68ùôøÖÖ¤Vhierwiki/macros/__init__.pycPKøW