tuple
()
tuple() -> an empty tuple tuple(sequence) -> tuple initialized from sequence's items
If the argument is a tuple, the return value is the same object.
Method __init__
__init__( self, name, path, url )
Undocumented
Method htmlPath
htmlPath( self, sep='/' )
Returns an HTML string with links for the whole page path
Method name
name( self )
Returns this page name (the filename without the directory name)
Method path
path( self )
Returns the path to this page. The path is relative to the site root (that is the Pages directory).
Method url
url( self )
This is the relative or absolute URL of the page.
Class Page
The Page object is created by Tahchee and made available to Pages when each page is compiled. It holds information on the page content.
Method _instanciatePlugins
_instanciatePlugins( self, module, site=None )
Method list
list( self, pluginsDir=None, site=None )
Undocumented
Class Plugins
A class that allows to easily manage plugins.
Method __init__
__init__( self, websiteURL, root='/Users/sebastien/Projects/Tahchee', mode='local', locals=None, **kwargs )
Initializes this basic site object. Pages are stored under the "Pages" directory, output directory is "Site", templates are stored in "Templates", all in the site root directory.
Method _detectHTMLTidy
_detectHTMLTidy( self, tidypath )
Utility function that looks if HTML tidy is installed
Method _processOptions
_processOptions( self, options )
Undocumented
Method absolutePath
absolutePath( self, path='' )
Returns the absolute normalized path for the given path, which must be relative to the current site root. When called with no argument, the site root is returned.
Method accepts
accepts( self, *args )
Adds the glob and specifies that it is accepted as a file by this site.
Method changeDetectionMethod
changeDetectionMethod( self )
Returns the type of file change detection method. The cheksum
method computes the SHA-1 signature for the file, while the modification
method uses the file last modification time.
Method err
err( self, msg )
Undocumented
Method error
error( self, msg )
Undocumented
Method fatal
fatal( self, msg )
Undocumented
Method hasToProcess
hasToProcess( self )
Tells if there are remaining files to be processed.
Method ignores
ignores( self, *args )
The given globs idenitfy files that won't be accepted by this site.
Method index
index( self, *args )
Tells that the given globs match index files.
Method info
info( self, msg )
Undocumented
Method isAccepted
isAccepted( self, path )
Tells wether this file is accepted or not.
Method isIndex
isIndex( self, path )
Tells wether the given path corresponds to an index or not.
Method isTemplate
isTemplate( self, path )
Tells if the given path represents a template, and returns the result.
Method log
log( self, msg )
Undocumented
Method mode
mode( self )
Returns the site mode, which is local by default.
Method name
name( self )
Returns the name for this website.
Method nextToProcess
nextToProcess( self )
Returns a triple (inputpath, outputpath, force) that indicates the next file that should be processed by the builder. This is an iteration method, which means that if the file is not processed and not re-added using willProcess
it will not be processed.
Method output
output( self )
Returns the output directory for this site.
Method pages
pages( self )
Returns the pages directory for this site.
Method plugins
plugins( self )
Returns a list of plugin instances that were detected for this site.
Method root
root( self )
Returns the root directory for this site.
Method setMode
setMode( self, mode )
Sets the mode to be local or remote. Mode is local by default.
Method sig
sig( self )
Returns this site signature as a string. The signature uniquely identifies this site. Each instance has a different signature.
Method templates
templates( self )
Returns a list of Cheetah templates (files ending in .tmpl or like .tmpl.xxxx) contained in the templates directory.
Method url
url( self )
Returns the URL for this website.
Method useTidy
useTidy( self )
Tells wether this site should use tidy to postprocess HTML templates.
Method warn
warn( self, msg )
Undocumented
Method warning
warning( self, msg )
Undocumented
Method willProcess
willProcess( self, inputPath, outputPath=None, force=False )
Registers the given file to be processed by the SiteBuilder when applying templates.
Class Site
The site object holds all information relative to a website, which are: the pages directory, which contains the pages, the output directory where the pages will be generated, and the templates directory that holds the Cheetah templates used to generate the files.
Method __init__
__init__( self, site )
Creates a new site builder that will create the HTML (and whatever other file types) from the website description held in the site object.
Method applyTemplate
applyTemplate( self, template, force=False )
Expands the given template to a file (generally an HTML or CSS file). The given path must be absolute.
Method applyTemplates
applyTemplates( self, templatePaths=None )
Apply the templates to every page template present in the pages directory.
Method build
build( self, paths=None )
Builds the website, or builds specifically the given paths.
Method copyCreatedFiles
copyCreatedFiles( self )
Copies the files created during the application of templates.
Method hasChanged
hasChanged( self, path )
Tells wether the given resource has changed since last build for this website or not. The path is converted to an absolute location, so moving the website directory will cause a rebuild.
Method loadChecksums
loadChecksums( self )
Loads the cheksums from a file named site.checksums
in the site root.
Method precompileTemplates
precompileTemplates( self )
Looks for Cheetah templates and precompile them (into Python code) if necessary
Method processFile
processFile( self, inputpath, outputpath, force=False )
Processes the given file, which is relative to the pages directory. If it is a .tmpl file, the template will be applied, otherwise, the file is just copied.
The given file must be given WITHIN the pages directory
Method saveChecksums
saveChecksums( self )
Saves the cheksums to a file named site.checksums
in the site root.
Class SiteBuilder
The SiteBuilder is the core of Tahchee, it uses the informations stored in the Site object from which it is initialized to build the web pages.
Function ensure_path
ensure_path( path )
Ensures that the path is well-formed. In particular, it escapes spaces from the the path name.
Function err
err( msg )
Undocumented
Function fatal
fatal( msg )
Undocumented
Function info
info( msg )
Undocumented
Function log
log( msg )
Undocumented
Function run
run( args )
Undocumented
Function shorten_path
shorten_path( path )
Undocumented
Function version
version( )
Undocumented
Function warn
warn( msg )
Undocumented
str
'## This is how we create a function in Cheetah. Here, the $site object is \n## a reference to Tahchee Site instance representing the current site. This\n## instance has a "link" method that allows to create a relative or absolute\n## link (depending on the mode - e.g. local or remote) in which the site is\n## built\n#def link(destination)\n$linking.link($page.path, $destination)#slurp\n#end def\n#def keywords\nENTER KEYWORDS HERE\n#end def\n#def head\n#end def\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n<html lang="fr">\n<head>\n <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" />\n <title>$title</title>\n <meta name="keywords" content="$keywords" />\n <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />\n <link rel="Shortcut Icon" href="$link(\'images/favicon.ico\')" type="image/x-icon" />\n <link rel="Stylesheet" title="Normal" media="screen" type="text/css" href="$link(\'screen.css\')" />\n <link rel="start" title="Home" href="index.html" />\n $head\n</head>\n<body>\n$body\n</body>\n</html>\n'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
str
'URL = "%s"\nMAIN = "index.html"\nSHOW_MAIN = True\nINDEXES = ["index.*"]\nIGNORES = ["*.sw?", "*.bak", "*.pyc", ".cvs", ".CVS", ".svn", ".DS_Store"]\nACCEPTS = []'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
str
'#!/usr/bin/env python\nimport os, sys\n# We add the Plugins path to the current Python path\nsys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "Plugins"))\ntry:\n\tfrom tahchee.main import *\nexcept:\n\tprint "Unable to import Tahchee."\n\tprint "Please check that the \'tahchee\' module is in your PYTHONPATH"\n\tsys.exit(-1)\n# You can change the following things\n# =============================================================================\n%s\n# =============================================================================\n# Do not modify this code\nif __name__ == "__main__":\n\tprint "tahchee v." + version()\n\tsite = Site(URL, locals=locals())\n\tif len(sys.argv)>1 and sys.argv[1].lower()=="remote": site.setMode("remote")\n\tSiteBuilder(site).build(filter(lambda x:x not in (\'local\',\'remote\'),sys.argv[1:]))\n'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
str
'signature'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
str
'date'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
str
'Tahchee v.0.9.8 \n\n allows to automatically build static websites from Cheetah templates. It\n features many useful function, such as relative or absolute linking, image\n generation, and automated build.\n\nUsage:\n\n tahchee create URL [DIRECTORY] (Creates a new website)\n tahchee update [DIRECTORY] (Updates website tahchee files)\n tahchee plugins (Lists available plugins)\n tahchee help [COMMAND] (Displays command help)\n tahchee version (Displays version info)\n\nLinks:\n\n <http://www.ivy.fr/tahchee> Tahchee website\n <http://www.cheetahtemplate.org> Cheetah website\n'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
str
"tahchee create URL [DIRECTORY]\n\n Creates a new Tahchee projet in the current directory or in the\n indicated directory.\n \n URL the URL of your website (eg. http://www.mysite.org)\n DIRECTORY the directory in which you want to create your project\n \n The directory will then hold a 'Makefile' file that you can simply\n call with the 'make' tool.will It will also be filled with the\n following subdirectories:\n\n Templates/ where you store all your page templates\n Pages/ your site Cheetah pages, CSS files, images, etc.\n Site/Local/ the version of your site made for local testing\n Site/Remote/ the version of your site made for uploading to remote site\n Fonts/ where you put your .ttf files\n Plugins/ drop your Python modules in here\n"
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
str
'tahchee plugins\n\n Displays the list of the plugins that Tahchee found for your local project.\n This will look both for the default Tahchee plugins, and for the ones found\n in your project `Plugins` directory.\n'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
str
'tahchee update [DIRECTORY]\n\n Updates your Tahchee project (`build.py` file and `Makefile`) so that it\n will work with the updated version of Tahchee.\n\n It is a good idea to run this command on your projects each time you\n update Tahchee.\n'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
str
'#extends Templates.Page\n#def title: Welcome to Tahchee\n#def header: <a href="http://www.ivy.fr/tahchee">Tahchee</a> v.0.9.8\n\n#def content\n<h1>Welcome to Tahchee</h1>\n\n<p><a href="http://www.ivy.fr/tahchee">Tahchee</a> is build system and an\nset of extensions to the <a href="http://www.cheetahtemplate.org">Cheetah</a>\ntemplate system.\n</p>\n\n<p>This page was created by the default templates provided, and will help you\nunderstand how to get started with Tahchee.</p>\n\n<p>You can get more information by reading the <a\nhref="http://www.ivy.fr/tahchee/manual.html">Tahchee Manual</a>. </p>\n\n#end def\n#def footer\n<a href="http://www.ivy.fr/tahchee">Tahchee</a> © <a href="http://www.ivy.fr">Ivy</a>, 2004-2006-.\n#end def\n'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
str
'# Tahchee makefile template version 0.9.8\nPYTHON = /usr/bin/env python\nLOCAL = Site/Local\nREMOTE = Site/Remote\n\nlocal:\n\t$(PYTHON) build.py local\n\nremote:\n\t$(PYTHON) build.py remote\n\nclean:\n\tfind . -name "*~" -or -name "*.sw?" -or -name "*.pyc" -exec rm {} \';\'\n\trm -rf $(LOCAL)/*\n\trm -rf $(REMOTE)/*\n\trm site.checksums\n\ninfo:\n\t@echo \'local - builds local website\'\n\t@echo \'remote - builds remote website\'\n\t@echo \'clean - cleans build and removes temp files\'\n\narchive: Pages Templates Makefile build.py \n\tmkdir tahchee-sources\n\tcp -r Pages Templates Makefile build.py tahchee-sources\n\ttar cvfj tahchee-sources.tar.bz2 tahchee-sources\n\trm -rf tahchee-sources\n\n.PHONY: local remote archive info clean \n'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
str
'## Here, we "extend" the base template, this is like an inhertiance between\n## page templates. Templates are all located in the Templates module, so\n## here, we simply say "this template extends the template Base.tmpl in the\n## Templates directory"\n#extends Templates.Base\n#def header\nENTER HEADER HERE\n#end def\n#def content\nENTER CONTENT HERE\n#end def\n#def footer\nENTER FOOTER HERE\n#end def\n#def body\n<div id="header">$header</div>\n<div id="content">$content</div>\n<div id="footer">$footer</div>\n#end def\n'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
SRE_Pattern
Compiled regular expression objects
SRE_Pattern
Compiled regular expression objects
str
'body{\n\tmargin-left:10%;\n margin-right:10%;\n padding:20pt;\n padding-top:10pt;\n background:rgb(255,255,255);\n font: 9pt/13pt "Lucida Grande",Lucida,sans-serif;\n color:rgb(80,80,80);;\n}\n\nh1,\nh2,\nh3,\nh4{\n\tfont-family:"Trebuchet MS",sans-serif;\n color:rgb(22, 130, 178);\n font-weight:normal;\n padding-top:0.5em;\n}\n\nstrong{\n\tcolor:rgb(103,183,0);\n}\n\na,\na:active,\na:visited{\n\tcolor:rgb(22,130,178);\n\ttext-decoration:none;\n}\na:hover{\n\ttext-decoration:underline;\n}\n\na img{\n\tborder:0;\n}\n\n\n#header, #footer{\n\tfont-size:7pt;\n\tclear:both;\n\twidth:100%;\n\tcolor:rgb(177,208,223);\n}\n\n#footer{\n\tpadding-top: 30pt;\n\ttext-align:right;\n}\n'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
str
'2.0'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
Module tahchee.main
Undocumented
Method __init__
__init__( self, site )
Undocumented
Method _abspath
_abspath( self, path )
Ensures that the path is absolute. This does not use the Python os.abspath method, but simply ensures that the path does not starts with .
and starts with a /
.
Method _normalize
_normalize( self, path )
Normalizes the given path, fixing some issues with Windows \ in paths.
Method a
a( self, target, content )
Undocumented
Method doc
doc( self )
Undocumented
Method hierarchy
hierarchy( self, pagePath )
Creates an HTML string that contains the clickable path from the website root to the current page. This can be placed in a navigation bar.
Method install
install( self, localdict )
Undocumented
Method link
link( self, fromPath, toPath, checkLink=True )
Creates a relative or absolute link (if the site is in local mode, then the link is relative, otherwise it is absolute) from the given path to the other path. The fromPath
is RELATIVE TO THE PAGES DIRECTORY.
Method name
name( self )
Undocumented
Method summary
summary( self )
Undocumented
Method version
version( self )
Undocumented
Class LinkingPlugin
Undocumented
str
'linking'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
str
'Useful functions to manage links within a site'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
Module tahchee.plugins.linking
Method __init__
__init__( self, site )
Undocumented
Method doc
doc( self )
Undocumented
Method install
install( self, localdict )
Undocumented
Method name
name( self )
Undocumented
Method roundRectangleCSS
roundRectangleCSS( self, cssClass, imagesDir, imagesPrefix, cornerSize )
Returns the definition for a table class that defines a rounded rectangle
Method roundRectangleHTML
roundRectangleHTML( self, className, start=True, end=False )
Undocumented
Method summary
summary( self )
Undocumented
Method text
text( self, text, fontName, fontSize, color, folder='images/text' )
Creates a transparent PNG image containing the given text, printed using the given font (taken from the fonts folder), with the given color (as a RGB tuple, or as a string with the hexadecimal code prefixed by relative to the site root. The image will be named TXXX.png, where the XXX is a sequence of 40 characters identifying the text image.
This function returns the path to the image.
Method version
version( self )
Undocumented
Class ImagingPlugin
Undocumented
str
'imaging'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
str
"table.$(cssclass) tr.upper td.left\n{ background: url('$(images)_ul.png') no-repeat top left; width : $(size)px; height: $(size)px;}\ntable.$(cssclass) tr.upper td.middle\n{ background: url('$(images)_um.png') repeat-x top; width : $(size)px; }\ntable.$(cssclass) tr.upper td.right\n{ background: url('$(images)_ur.png') no-repeat top right; width : $(size)px; height: $(size)px;}\ntable.$(cssclass) tr.middle td.left\n{ background: url('$(images)_ml.png') repeat-y top left; width : $(size)px; }\ntable.$(cssclass) tr.middle td.middle\n{ background: url('$(images)_mm.png'); }\ntable.$(cssclass) tr.middle td.right\n{ background: url('$(images)_mr.png') repeat-y top right; width : $(size)px; }\ntable.$(cssclass) tr.lower td.left\n{ background: url('$(images)_ll.png') no-repeat bottom left; width : $(size)px; height: $(size)px;}\ntable.$(cssclass) tr.lower td.middle\n{ background: url('$(images)_lm.png') repeat-x bottom left; height: $(size)px;}\ntable.$(cssclass) tr.lower td.right\n{ background: url('$(images)_lr.png') no-repeat bottom right; width : $(size)px; height: $(size)px;}\n"
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
str
'\\\t\n\t</td>\n\t\t<td class="right"> </td>\n\t</tr>\n\t<tr class="lower">\n\t\t<td class="left"> </td>\n\t\t<td class="middle"> </td>\n\t\t<td class="right"> </td>\n\t</tr>\n</table>'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
str
'<table class="CLASS" cellpadding="0" cellspacing="0">\n\t<tr class="upper">\n\t\t<td class="left"> </td>\n\t\t<td class="middle"> </td>\n\t\t<td class="right"> </td>\n\t</tr>\n\t<tr class="middle">\n\t\t<td class="left"> </td>\n\t\t<td class="middle">\n'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
str
'Image generation and processing (fonts, rounded corners)'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
Module tahchee.plugins.imaging
1.Tahchee Imaging Module
The Imaging module is an easy and powerful way to easily generate bitmap images to integrate into your pages. This module allows you to:
- Render text using custom fonts (TTF files put in your
Fonts
dir) - Generate rounded-corner images, with CSS and HTML code ready for your pages
Method __call__
__call__( self, text, level=0 )
Undocumented
Method __init__
__init__( self, site )
Undocumented
Method doc
doc( self )
Undocumented
Method include
include( self, path )
Undocumented
Method install
install( self, localdict )
Undocumented
Method name
name( self )
Undocumented
Method process
process( self, text, level=0 )
If Kiwi is available, the given text will be interpreted as Kiwi markup and HTML will be generated from it. If Kiwi is not available, a warning will be issued, and the text will be displayed as-is.
Method summary
summary( self )
Undocumented
Method version
version( self )
Undocumented
Class KiwiPlugin
Undocumented
str
'kiwi'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
str
'Kiwi markup to HTML conversion functions.'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
Module tahchee.plugins.markup
Undocumented
Method __call__
__call__( self, text )
Undocumented
Method __init__
__init__( self, site )
Undocumented
Method doc
doc( self )
Undocumented
Method install
install( self, localdict )
Undocumented
Method name
name( self )
Undocumented
Method summary
summary( self )
Undocumented
Method toHTML
toHTML( self, text )
Returns the given HTML with ampersands, quotes and carets encoded
Method toText
toText( self, text )
Expands the entities found in the given text and returns it as text.
Method version
version( self )
Undocumented
Class EscapePlugin
Undocumented
str
'escape'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
str
'Escapes a string so that it can be safely included into an HTML document.'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
Module tahchee.plugins.escape
Undocumented
Method text
text( self, text, fontName, fontSize, color, folder='images/text' )
Creates a transparent PNG image containing the given text, printed using the given font (taken from the fonts folder), with the given color (as a RGB tuple, or as a string with the hexadecimal code prefixed by relative to the site root. The image will be named TXXX.png, where the XXX is a sequence of 40 characters identifying the text image.
This function returns the path to the image.
Method templates
templates( self )
Returns a list of Cheetah templates (files ending in .tmpl or like .tmpl.xxxx) contained in the templates directory.
Method install
install( self, localdict )
Undocumented
Class EscapePlugin
Undocumented
Function err
err( msg )
Undocumented
str
"table.$(cssclass) tr.upper td.left\n{ background: url('$(images)_ul.png') no-repeat top left; width : $(size)px; height: $(size)px;}\ntable.$(cssclass) tr.upper td.middle\n{ background: url('$(images)_um.png') repeat-x top; width : $(size)px; }\ntable.$(cssclass) tr.upper td.right\n{ background: url('$(images)_ur.png') no-repeat top right; width : $(size)px; height: $(size)px;}\ntable.$(cssclass) tr.middle td.left\n{ background: url('$(images)_ml.png') repeat-y top left; width : $(size)px; }\ntable.$(cssclass) tr.middle td.middle\n{ background: url('$(images)_mm.png'); }\ntable.$(cssclass) tr.middle td.right\n{ background: url('$(images)_mr.png') repeat-y top right; width : $(size)px; }\ntable.$(cssclass) tr.lower td.left\n{ background: url('$(images)_ll.png') no-repeat bottom left; width : $(size)px; height: $(size)px;}\ntable.$(cssclass) tr.lower td.middle\n{ background: url('$(images)_lm.png') repeat-x bottom left; height: $(size)px;}\ntable.$(cssclass) tr.lower td.right\n{ background: url('$(images)_lr.png') no-repeat bottom right; width : $(size)px; height: $(size)px;}\n"
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
Method link
link( self, fromPath, toPath, checkLink=True )
Creates a relative or absolute link (if the site is in local mode, then the link is relative, otherwise it is absolute) from the given path to the other path. The fromPath
is RELATIVE TO THE PAGES DIRECTORY.
str
'tahchee update [DIRECTORY]\n\n Updates your Tahchee project (`build.py` file and `Makefile`) so that it\n will work with the updated version of Tahchee.\n\n It is a good idea to run this command on your projects each time you\n update Tahchee.\n'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
str
'Kiwi markup to HTML conversion functions.'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
Method toHTML
toHTML( self, text )
Returns the given HTML with ampersands, quotes and carets encoded
Class LinkingPlugin
Undocumented
str
'## This is how we create a function in Cheetah. Here, the $site object is \n## a reference to Tahchee Site instance representing the current site. This\n## instance has a "link" method that allows to create a relative or absolute\n## link (depending on the mode - e.g. local or remote) in which the site is\n## built\n#def link(destination)\n$linking.link($page.path, $destination)#slurp\n#end def\n#def keywords\nENTER KEYWORDS HERE\n#end def\n#def head\n#end def\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n<html lang="fr">\n<head>\n <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" />\n <title>$title</title>\n <meta name="keywords" content="$keywords" />\n <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />\n <link rel="Shortcut Icon" href="$link(\'images/favicon.ico\')" type="image/x-icon" />\n <link rel="Stylesheet" title="Normal" media="screen" type="text/css" href="$link(\'screen.css\')" />\n <link rel="start" title="Home" href="index.html" />\n $head\n</head>\n<body>\n$body\n</body>\n</html>\n'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
Method doc
doc( self )
Undocumented
Method loadChecksums
loadChecksums( self )
Loads the cheksums from a file named site.checksums
in the site root.
Class ImagingPlugin
Undocumented
Method copyCreatedFiles
copyCreatedFiles( self )
Copies the files created during the application of templates.
Method hasChanged
hasChanged( self, path )
Tells wether the given resource has changed since last build for this website or not. The path is converted to an absolute location, so moving the website directory will cause a rebuild.
Method willProcess
willProcess( self, inputPath, outputPath=None, force=False )
Registers the given file to be processed by the SiteBuilder when applying templates.
Class SiteBuilder
The SiteBuilder is the core of Tahchee, it uses the informations stored in the Site object from which it is initialized to build the web pages.
Method warn
warn( self, msg )
Undocumented
Method warning
warning( self, msg )
Undocumented
Method applyTemplates
applyTemplates( self, templatePaths=None )
Apply the templates to every page template present in the pages directory.
Method build
build( self, paths=None )
Builds the website, or builds specifically the given paths.
Method __init__
__init__( self, site )
Creates a new site builder that will create the HTML (and whatever other file types) from the website description held in the site object.
Method applyTemplate
applyTemplate( self, template, force=False )
Expands the given template to a file (generally an HTML or CSS file). The given path must be absolute.
Method root
root( self )
Returns the root directory for this site.
Method setMode
setMode( self, mode )
Sets the mode to be local or remote. Mode is local by default.
Method pages
pages( self )
Returns the pages directory for this site.
Method plugins
plugins( self )
Returns a list of plugin instances that were detected for this site.
Method url
url( self )
Returns the URL for this website.
Method useTidy
useTidy( self )
Tells wether this site should use tidy to postprocess HTML templates.
Method sig
sig( self )
Returns this site signature as a string. The signature uniquely identifies this site. Each instance has a different signature.
Method processFile
processFile( self, inputpath, outputpath, force=False )
Processes the given file, which is relative to the pages directory. If it is a .tmpl file, the template will be applied, otherwise, the file is just copied.
The given file must be given WITHIN the pages directory
Method isTemplate
isTemplate( self, path )
Tells if the given path represents a template, and returns the result.
Method log
log( self, msg )
Undocumented
Method isIndex
isIndex( self, path )
Tells wether the given path corresponds to an index or not.
Method nextToProcess
nextToProcess( self )
Returns a triple (inputpath, outputpath, force) that indicates the next file that should be processed by the builder. This is an iteration method, which means that if the file is not processed and not re-added using willProcess
it will not be processed.
Method output
output( self )
Returns the output directory for this site.
Method mode
mode( self )
Returns the site mode, which is local by default.
Method name
name( self )
Returns the name for this website.
Method isAccepted
isAccepted( self, path )
Tells wether this file is accepted or not.
Method index
index( self, *args )
Tells that the given globs match index files.
Method info
info( self, msg )
Undocumented
Method summary
summary( self )
Undocumented
str
'Tahchee v.0.9.8 \n\n allows to automatically build static websites from Cheetah templates. It\n features many useful function, such as relative or absolute linking, image\n generation, and automated build.\n\nUsage:\n\n tahchee create URL [DIRECTORY] (Creates a new website)\n tahchee update [DIRECTORY] (Updates website tahchee files)\n tahchee plugins (Lists available plugins)\n tahchee help [COMMAND] (Displays command help)\n tahchee version (Displays version info)\n\nLinks:\n\n <http://www.ivy.fr/tahchee> Tahchee website\n <http://www.cheetahtemplate.org> Cheetah website\n'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
Method changeDetectionMethod
changeDetectionMethod( self )
Returns the type of file change detection method. The cheksum
method computes the SHA-1 signature for the file, while the modification
method uses the file last modification time.
Method err
err( self, msg )
Undocumented
Method absolutePath
absolutePath( self, path='' )
Returns the absolute normalized path for the given path, which must be relative to the current site root. When called with no argument, the site root is returned.
Method accepts
accepts( self, *args )
Adds the glob and specifies that it is accepted as a file by this site.
Method hasToProcess
hasToProcess( self )
Tells if there are remaining files to be processed.
Method error
error( self, msg )
Undocumented
Method fatal
fatal( self, msg )
Undocumented
Method _instanciatePlugins
_instanciatePlugins( self, module, site=None )
Method list
list( self, pluginsDir=None, site=None )
Undocumented
Method __init__
__init__( self, site )
Undocumented
Class Plugins
A class that allows to easily manage plugins.
Method _detectHTMLTidy
_detectHTMLTidy( self, tidypath )
Utility function that looks if HTML tidy is installed
Method _processOptions
_processOptions( self, options )
Undocumented
Class Site
The site object holds all information relative to a website, which are: the pages directory, which contains the pages, the output directory where the pages will be generated, and the templates directory that holds the Cheetah templates used to generate the files.
Method __init__
__init__( self, websiteURL, root='/Users/sebastien/Projects/Tahchee', mode='local', locals=None, **kwargs )
Initializes this basic site object. Pages are stored under the "Pages" directory, output directory is "Site", templates are stored in "Templates", all in the site root directory.
Class Page
The Page object is created by Tahchee and made available to Pages when each page is compiled. It holds information on the page content.
tuple
()
tuple() -> an empty tuple tuple(sequence) -> tuple initialized from sequence's items
If the argument is a tuple, the return value is the same object.
Module tahchee.main
Undocumented
Method name
name( self )
Returns this page name (the filename without the directory name)
Method path
path( self )
Returns the path to this page. The path is relative to the site root (that is the Pages directory).
Method __init__
__init__( self, name, path, url )
Undocumented
Function shorten_path
shorten_path( path )
Undocumented
str
'#!/usr/bin/env python\nimport os, sys\n# We add the Plugins path to the current Python path\nsys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "Plugins"))\ntry:\n\tfrom tahchee.main import *\nexcept:\n\tprint "Unable to import Tahchee."\n\tprint "Please check that the \'tahchee\' module is in your PYTHONPATH"\n\tsys.exit(-1)\n# You can change the following things\n# =============================================================================\n%s\n# =============================================================================\n# Do not modify this code\nif __name__ == "__main__":\n\tprint "tahchee v." + version()\n\tsite = Site(URL, locals=locals())\n\tif len(sys.argv)>1 and sys.argv[1].lower()=="remote": site.setMode("remote")\n\tSiteBuilder(site).build(filter(lambda x:x not in (\'local\',\'remote\'),sys.argv[1:]))\n'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
Method install
install( self, localdict )
Undocumented
Method ignores
ignores( self, *args )
The given globs idenitfy files that won't be accepted by this site.
Method doc
doc( self )
Undocumented
Function info
info( msg )
Undocumented
str
'<table class="CLASS" cellpadding="0" cellspacing="0">\n\t<tr class="upper">\n\t\t<td class="left"> </td>\n\t\t<td class="middle"> </td>\n\t\t<td class="right"> </td>\n\t</tr>\n\t<tr class="middle">\n\t\t<td class="left"> </td>\n\t\t<td class="middle">\n'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
Method summary
summary( self )
Undocumented
Method roundRectangleCSS
roundRectangleCSS( self, cssClass, imagesDir, imagesPrefix, cornerSize )
Returns the definition for a table class that defines a rounded rectangle
str
'# Tahchee makefile template version 0.9.8\nPYTHON = /usr/bin/env python\nLOCAL = Site/Local\nREMOTE = Site/Remote\n\nlocal:\n\t$(PYTHON) build.py local\n\nremote:\n\t$(PYTHON) build.py remote\n\nclean:\n\tfind . -name "*~" -or -name "*.sw?" -or -name "*.pyc" -exec rm {} \';\'\n\trm -rf $(LOCAL)/*\n\trm -rf $(REMOTE)/*\n\trm site.checksums\n\ninfo:\n\t@echo \'local - builds local website\'\n\t@echo \'remote - builds remote website\'\n\t@echo \'clean - cleans build and removes temp files\'\n\narchive: Pages Templates Makefile build.py \n\tmkdir tahchee-sources\n\tcp -r Pages Templates Makefile build.py tahchee-sources\n\ttar cvfj tahchee-sources.tar.bz2 tahchee-sources\n\trm -rf tahchee-sources\n\n.PHONY: local remote archive info clean \n'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
Method url
url( self )
This is the relative or absolute URL of the page.
Method toText
toText( self, text )
Expands the entities found in the given text and returns it as text.
Method version
version( self )
Undocumented
Method _abspath
_abspath( self, path )
Ensures that the path is absolute. This does not use the Python os.abspath method, but simply ensures that the path does not starts with .
and starts with a /
.
str
'Useful functions to manage links within a site'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
Method doc
doc( self )
Undocumented
str
'imaging'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
Function ensure_path
ensure_path( path )
Ensures that the path is well-formed. In particular, it escapes spaces from the the path name.
str
'kiwi'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
str
'tahchee plugins\n\n Displays the list of the plugins that Tahchee found for your local project.\n This will look both for the default Tahchee plugins, and for the ones found\n in your project `Plugins` directory.\n'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
Method version
version( self )
Undocumented
Class KiwiPlugin
Undocumented
Method __init__
__init__( self, site )
Undocumented
Function warn
warn( msg )
Undocumented
Method htmlPath
htmlPath( self, sep='/' )
Returns an HTML string with links for the whole page path
Method _normalize
_normalize( self, path )
Normalizes the given path, fixing some issues with Windows \ in paths.
str
'escape'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
Method __call__
__call__( self, text )
Undocumented
str
'## Here, we "extend" the base template, this is like an inhertiance between\n## page templates. Templates are all located in the Templates module, so\n## here, we simply say "this template extends the template Base.tmpl in the\n## Templates directory"\n#extends Templates.Base\n#def header\nENTER HEADER HERE\n#end def\n#def content\nENTER CONTENT HERE\n#end def\n#def footer\nENTER FOOTER HERE\n#end def\n#def body\n<div id="header">$header</div>\n<div id="content">$content</div>\n<div id="footer">$footer</div>\n#end def\n'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
Method precompileTemplates
precompileTemplates( self )
Looks for Cheetah templates and precompile them (into Python code) if necessary
Method summary
summary( self )
Undocumented
Method install
install( self, localdict )
Undocumented
Method name
name( self )
Undocumented
str
'signature'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
Function run
run( args )
Undocumented
Module tahchee.plugins.markup
Undocumented
Module tahchee.plugins.imaging
1.Tahchee Imaging Module
The Imaging module is an easy and powerful way to easily generate bitmap images to integrate into your pages. This module allows you to:
- Render text using custom fonts (TTF files put in your
Fonts
dir) - Generate rounded-corner images, with CSS and HTML code ready for your pages
Method include
include( self, path )
Undocumented
str
'URL = "%s"\nMAIN = "index.html"\nSHOW_MAIN = True\nINDEXES = ["index.*"]\nIGNORES = ["*.sw?", "*.bak", "*.pyc", ".cvs", ".CVS", ".svn", ".DS_Store"]\nACCEPTS = []'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
SRE_Pattern
Compiled regular expression objects
Method __init__
__init__( self, site )
Undocumented
str
'Escapes a string so that it can be safely included into an HTML document.'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
Method a
a( self, target, content )
Undocumented
str
'\\\t\n\t</td>\n\t\t<td class="right"> </td>\n\t</tr>\n\t<tr class="lower">\n\t\t<td class="left"> </td>\n\t\t<td class="middle"> </td>\n\t\t<td class="right"> </td>\n\t</tr>\n</table>'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
Function fatal
fatal( msg )
Undocumented
str
'date'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
Method process
process( self, text, level=0 )
If Kiwi is available, the given text will be interpreted as Kiwi markup and HTML will be generated from it. If Kiwi is not available, a warning will be issued, and the text will be displayed as-is.
Method name
name( self )
Undocumented
Module tahchee.plugins.escape
Undocumented
str
'#extends Templates.Page\n#def title: Welcome to Tahchee\n#def header: <a href="http://www.ivy.fr/tahchee">Tahchee</a> v.0.9.8\n\n#def content\n<h1>Welcome to Tahchee</h1>\n\n<p><a href="http://www.ivy.fr/tahchee">Tahchee</a> is build system and an\nset of extensions to the <a href="http://www.cheetahtemplate.org">Cheetah</a>\ntemplate system.\n</p>\n\n<p>This page was created by the default templates provided, and will help you\nunderstand how to get started with Tahchee.</p>\n\n<p>You can get more information by reading the <a\nhref="http://www.ivy.fr/tahchee/manual.html">Tahchee Manual</a>. </p>\n\n#end def\n#def footer\n<a href="http://www.ivy.fr/tahchee">Tahchee</a> © <a href="http://www.ivy.fr">Ivy</a>, 2004-2006-.\n#end def\n'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
str
'body{\n\tmargin-left:10%;\n margin-right:10%;\n padding:20pt;\n padding-top:10pt;\n background:rgb(255,255,255);\n font: 9pt/13pt "Lucida Grande",Lucida,sans-serif;\n color:rgb(80,80,80);;\n}\n\nh1,\nh2,\nh3,\nh4{\n\tfont-family:"Trebuchet MS",sans-serif;\n color:rgb(22, 130, 178);\n font-weight:normal;\n padding-top:0.5em;\n}\n\nstrong{\n\tcolor:rgb(103,183,0);\n}\n\na,\na:active,\na:visited{\n\tcolor:rgb(22,130,178);\n\ttext-decoration:none;\n}\na:hover{\n\ttext-decoration:underline;\n}\n\na img{\n\tborder:0;\n}\n\n\n#header, #footer{\n\tfont-size:7pt;\n\tclear:both;\n\twidth:100%;\n\tcolor:rgb(177,208,223);\n}\n\n#footer{\n\tpadding-top: 30pt;\n\ttext-align:right;\n}\n'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
Method install
install( self, localdict )
Undocumented
Module tahchee.plugins.linking
str
'linking'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
Method __init__
__init__( self, site )
Undocumented
Method saveChecksums
saveChecksums( self )
Saves the cheksums to a file named site.checksums
in the site root.
Method version
version( self )
Undocumented
Method doc
doc( self )
Undocumented
SRE_Pattern
Compiled regular expression objects
Method name
name( self )
Undocumented
Function version
version( )
Undocumented
Method __call__
__call__( self, text, level=0 )
Undocumented
Method name
name( self )
Undocumented
str
'2.0'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
str
"tahchee create URL [DIRECTORY]\n\n Creates a new Tahchee projet in the current directory or in the\n indicated directory.\n \n URL the URL of your website (eg. http://www.mysite.org)\n DIRECTORY the directory in which you want to create your project\n \n The directory will then hold a 'Makefile' file that you can simply\n call with the 'make' tool.will It will also be filled with the\n following subdirectories:\n\n Templates/ where you store all your page templates\n Pages/ your site Cheetah pages, CSS files, images, etc.\n Site/Local/ the version of your site made for local testing\n Site/Remote/ the version of your site made for uploading to remote site\n Fonts/ where you put your .ttf files\n Plugins/ drop your Python modules in here\n"
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
Method version
version( self )
Undocumented
Method hierarchy
hierarchy( self, pagePath )
Creates an HTML string that contains the clickable path from the website root to the current page. This can be placed in a navigation bar.
Method summary
summary( self )
Undocumented
Method roundRectangleHTML
roundRectangleHTML( self, className, start=True, end=False )
Undocumented
str
'Image generation and processing (fonts, rounded corners)'
str(object) -> string
Return a nice string representation of the object. If the argument is a string, the return value is the same object.
Function log
log( msg )
Undocumented