Back to index

plone3  3.1.7
content.py
Go to the documentation of this file.
00001 DOCTYPE = '''<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'''
00002 
00003 HTML_TEMPLATE = '''\
00004 <html><head>
00005  <title>%(title)s</title>
00006 </head>
00007 <body bgcolor="#efe843">%(body)s</body>
00008 </html>
00009 '''
00010 
00011 SIMPLE_HTML = '''\
00012 <html>
00013  <head>
00014   <title>Title in tag</title>
00015   <meta name="description" content="Describe me">
00016   <meta name="contributors" content="foo@bar.com; baz@bam.net;
00017     Benotz, Larry J (larry@benotz.stuff)">
00018   <meta name="title" content="Title in meta">
00019   <meta name="subject" content="content management">
00020  </head>
00021  <body bgcolor="#ffffff">
00022   <h1>Not a lot here</h1>
00023  </body>
00024 </html>
00025 '''
00026 
00027 BASIC_HTML = '''\
00028 <html>
00029  <head>
00030   <title>Title in tag</title>
00031   <meta name="description" content="Describe me">
00032   <meta name="contributors" content="foo@bar.com; baz@bam.net;
00033     Benotz, Larry J (larry@benotz.stuff)">
00034   <meta name="title" content="Title in meta">
00035   <meta name="subject" content="content management">
00036   <meta name="keywords" content="unit tests, framework; ,zope ">
00037  </head>
00038  <body bgcolor="#ffffff">
00039   <h1>Not a lot here</h1>
00040  </body>
00041 </html>
00042 '''
00043 
00044 SIMPLE_XHTML = """\
00045 <?xml version="1.0" encoding="UTF-8"?>
00046 <!DOCTYPE html
00047     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
00048     "DTD/xhtml1-transitional.dtd">
00049 <html xmlns="http://www.w3.org/1999/xhtml">
00050  <head>
00051   <title>Title in tag</title>
00052   <meta name="description" content="Describe me" />
00053   <meta name="contributors" content="foo@bar.com; baz@bam.net;
00054     Benotz, Larry J (larry@benotz.stuff)" />
00055   <meta name="title" content="Title in meta" />
00056   <meta name="subject" content="content management" />
00057  </head>
00058  <body bgcolor="#ffffff">
00059   <h1>Not a lot here</h1>
00060  </body>
00061 </html>
00062 """
00063 
00064 # A document with an html-qualifying *portion*.
00065 FAUX_HTML_LEADING_TEXT = '''\
00066 The following would look like HTML but for this leading text:
00067 
00068 <html>
00069  <head>
00070   <title>Title in tag</title>
00071   <meta name="description" content="Describe me">
00072   <meta name="contributors" content="foo@bar.com; baz@bam.net;
00073     Benotz, Larry J (larry@benotz.stuff)">
00074   <meta name="title" content="Title in meta">
00075   <meta name="subject" content="content management">
00076   <meta name="keywords" content="unit tests, framework; ,zope ">
00077  </head>
00078  <body bgcolor="#ffffff">
00079   <h1>Not a lot here</h1>
00080  </body>
00081 </html>
00082 '''
00083 
00084 ENTITY_IN_TITLE = '''\
00085 <html>
00086  <head>
00087   <title>&Auuml;rger</title>
00088  </head>
00089  <bOdY>
00090   <h2>Not a lot here either</h2>
00091  </bodY>
00092 </html>
00093 '''
00094 
00095 SIMPLE_STRUCTUREDTEXT = '''\
00096 Title: My Document
00097 Description: A document by me
00098 Contributors: foo@bar.com; baz@bam.net; no@yes.maybe
00099 Subject: content management, zope
00100 
00101 This is the header
00102 
00103   Body body body body body
00104   body body body.
00105 
00106    o A list item
00107 
00108    o And another thing...
00109 '''
00110 
00111 BASIC_STRUCTUREDTEXT = '''\
00112 Title: My Document
00113 Description: A document by me
00114 Contributors: foo@bar.com; baz@bam.net; no@yes.maybe
00115 Subject: content management, zope
00116 Keywords: unit tests; , framework
00117 
00118 This is the header
00119 
00120   Body body body body body
00121   body body body.
00122 
00123    o A list item
00124 
00125    o And another thing...
00126 '''
00127 
00128 STX_WITH_HTML = """\
00129 Sometimes people do interesting things
00130 
00131   Sometimes people do interesting things like have examples
00132   of HTML inside their structured text document.  We should
00133   be detecting that this is indeed a structured text document
00134   and **NOT** an HTML document::
00135 
00136     <html>
00137     <head><title>Hello World</title></head>
00138     <body><p>Hello world, I am Bruce.</p></body>
00139     </html>
00140 
00141   All in favor say pi!
00142 """
00143 
00144 
00145 STX_NO_HEADERS = """\
00146 Title Phrase
00147 
00148     This is a "plain" STX file, with no headers.  Saving with
00149     it shouldn't overwrite any metadata.
00150 """
00151 
00152 STX_NO_HEADERS_BUT_COLON = """\
00153 Plain STX:  No magic!
00154 
00155     This is a "plain" STX file, with no headers.  Saving with
00156     it shouldn't overwrite any metadata.
00157 """
00158 
00159 BASIC_RFC822 = """\
00160 Title: Zope Community
00161 Description: Link to the Zope Community website.
00162 Subject: open source; Zope; community
00163 
00164 http://www.zope.org
00165 """
00166 
00167 RFC822_W_CONTINUATION = """\
00168 Title: Zope Community
00169 Description: Link to the Zope Community website,
00170   including hundreds of contributed Zope products.
00171 Subject: open source; Zope; community
00172 
00173 http://www.zope.org
00174 """