Back to index

moin  1.9.0~rc2
Classes | Functions | Variables
MoinMoin.script.export.dump Namespace Reference

Classes

class  PluginScript

Functions

def _attachment

Variables

string url_prefix_static = "."
string logo_html = '<img src="logo.png">'
string HTML_SUFFIX = ".html"
string page_template = u''

Function Documentation

def MoinMoin.script.export.dump._attachment (   request,
  pagename,
  filename,
  outputdir,
  kw 
) [private]

Definition at line 70 of file dump.py.

00070 
00071 def _attachment(request, pagename, filename, outputdir, **kw):
00072     filename = filename.encode(config.charset)
00073     source_dir = AttachFile.getAttachDir(request, pagename)
00074     source_file = os.path.join(source_dir, filename)
00075     dest_dir = os.path.join(outputdir, "attachments", wikiutil.quoteWikinameFS(pagename))
00076     dest_file = os.path.join(dest_dir, filename)
00077     dest_url = "attachments/%s/%s" % (wikiutil.quoteWikinameFS(pagename), wikiutil.url_quote(filename))
00078     if os.access(source_file, os.R_OK):
00079         if not os.access(dest_dir, os.F_OK):
00080             try:
00081                 os.makedirs(dest_dir)
00082             except:
00083                 script.fatal("Cannot create attachment directory '%s'" % dest_dir)
00084         elif not os.path.isdir(dest_dir):
00085             script.fatal("'%s' is not a directory" % dest_dir)
00086 
00087         shutil.copyfile(source_file, dest_file)
00088         script.log('Writing "%s"...' % dest_url)
00089         return dest_url
00090     else:
00091         return ""
00092 

Here is the caller graph for this function:


Variable Documentation

Definition at line 18 of file dump.py.

string MoinMoin.script.export.dump.logo_html = '<img src="logo.png">'

Definition at line 17 of file dump.py.

Definition at line 20 of file dump.py.

Definition at line 16 of file dump.py.