Ejemplo n.º 1
0
#!/usr/bin/env python
# Copyright (c) 2011 Evan Sonderegger
# License: MIT (http://www.opensource.org/licenses/mit-license.php)

import os
import algaeHtmlBlocks
import algaeModels
import algaePython

pathInfo = os.environ.get("PATH_INFO")
postRequested = pathInfo[7:]
thePost = algaeModels.getContentFromCleanURL(postRequested, "blogPost")

print "Content-Type: text/html \n"
print "<!DOCTYPE html>"
print '<html lang="en">'
if thePost:
    algaeHtmlBlocks.commonHeader(thePost.postTitle)
else:
    algaeHtmlBlocks.commonHeader("Content Not Found")
print "<body>"
print '<div id="mainDiv">'
algaeHtmlBlocks.titleBlock()
algaeHtmlBlocks.displayNav()
print '<div id="thePost" class="normalContent">'
if thePost:
    thePost.printArticle(link=False)
else:
    print "<h1>Content not found.</h1>"
print "</div>"
print "</div>"
Ejemplo n.º 2
0
# License: MIT (http://www.opensource.org/licenses/mit-license.php)

import os
import algaeModels

pathInfo = os.environ.get('PATH_INFO')
postRequested = pathInfo[8:]
if postRequested.find('_') > 0:
  imageRequested = postRequested[:postRequested.find('_')]
  versionRequested = postRequested[postRequested.find('_') + 1:postRequested.find('_') + 3]
elif postRequested.find('.') > 0:
  imageRequested = postRequested[:postRequested.find('.')]
  versionRequested = 'original'
else:
  imageRequested = postRequested
  versionRequested = 'original'
theImage = algaeModels.getContentFromCleanURL(imageRequested, 'algaeImage')

if theImage:
  print 'Content-Type: ' + theImage.mimeType + '\n'
  if versionRequested == 'sm':
    print theImage.smData
  elif versionRequested == 'md':
    print theImage.mdData
  else:
    print theImage.imgData
else:
  print '<!DOCTYPE html>'
  print '<html lang="en">'
  print '<h1>Content not found.</h1>'
  print '</html>'
Ejemplo n.º 3
0
#!/usr/bin/env python
# Copyright (c) 2011 Evan Sonderegger
# License: MIT (http://www.opensource.org/licenses/mit-license.php)

import os
import algaeModels
pathInfo = os.environ.get('PATH_INFO')
postRequested = pathInfo[4:]
thePage = algaeModels.getContentFromCleanURL(postRequested, 'jScript')

if thePage:
  print 'Content-Type: text/x-js \n'
  print thePage.postText
elif os.path.exists('./js/' + postRequested):
  file = open('./js/' + postRequested, 'r')
  print 'Content-Type: text/x-js \n'
  print file.read()
else:
  print '<!DOCTYPE html>'
  print '<html lang="en">'
  print '<h1>Content not found.</h1>'
  print '</html>'
Ejemplo n.º 4
0
#!/usr/bin/env python
# Copyright (c) 2011 Evan Sonderegger
# License: MIT (http://www.opensource.org/licenses/mit-license.php)

import os
import algaeHtmlBlocks
import algaeModels
import algaePython
pathInfo = os.environ.get('PATH_INFO')
postRequested = pathInfo[7:]
thePage = algaeModels.getContentFromCleanURL(postRequested, 'basicPage')

print 'Content-Type: text/html \n'
print '<!DOCTYPE html>'
print '<html lang="en">'
if thePage:
  algaeHtmlBlocks.commonHeader(thePage.postTitle.encode('utf-8'))
else:
  algaeHtmlBlocks.commonHeader('Content Not Found')
print '<body>'
algaeHtmlBlocks.titleBlock()
algaeHtmlBlocks.displayNav()
print '<article class="normalContent">'
if thePage:
  print thePage.markdownText.encode('utf-8')
else:
  print '<h1>Content not found.</h1>'
print '</article>'
print '</body>'
print '</html>'
Ejemplo n.º 5
0
#!/usr/bin/env python
# Copyright (c) 2011 Evan Sonderegger
# License: MIT (http://www.opensource.org/licenses/mit-license.php)

import os
import algaeHtmlBlocks
import algaeModels
import algaePython
pathInfo = os.environ.get('PATH_INFO')
postRequested = pathInfo[7:]
thePage = algaeModels.getContentFromCleanURL(postRequested, 'basicPage')

print 'Content-Type: text/html \n'
print '<!DOCTYPE html>'
print '<html lang="en">'
if thePage:
    algaeHtmlBlocks.commonHeader(thePage.postTitle.encode('utf-8'))
else:
    algaeHtmlBlocks.commonHeader('Content Not Found')
print '<body>'
algaeHtmlBlocks.titleBlock()
algaeHtmlBlocks.displayNav()
print '<article class="normalContent">'
if thePage:
    print thePage.markdownText.encode('utf-8')
else:
    print '<h1>Content not found.</h1>'
print '</article>'
print '</body>'
print '</html>'
Ejemplo n.º 6
0
#!/usr/bin/env python
# Copyright (c) 2011 Evan Sonderegger
# License: MIT (http://www.opensource.org/licenses/mit-license.php)

import os
import algaeModels
pathInfo = os.environ.get('PATH_INFO')
postRequested = pathInfo[5:]
thePage = algaeModels.getContentFromCleanURL(postRequested, 'styleSheet')

if thePage:
  print 'Content-Type: text/css \n'
  print thePage.postText
elif os.path.exists('./css/' + postRequested):
  file = open('./css/' + postRequested, 'r')
  print 'Content-Type: text/css \n'
  print file.read()
else:
  print '<!DOCTYPE html>'
  print '<html lang="en">'
  print '<h1>Content not found.</h1>'
  print '</html>'
Ejemplo n.º 7
0
#!/usr/bin/env python
# Copyright (c) 2011 Evan Sonderegger
# License: MIT (http://www.opensource.org/licenses/mit-license.php)

import os
import algaeModels
pathInfo = os.environ.get('PATH_INFO')
postRequested = pathInfo[5:]
thePage = algaeModels.getContentFromCleanURL(postRequested, 'styleSheet')

if thePage:
    print 'Content-Type: text/css \n'
    print thePage.postText
elif os.path.exists('./css/' + postRequested):
    file = open('./css/' + postRequested, 'r')
    print 'Content-Type: text/css \n'
    print file.read()
else:
    print '<!DOCTYPE html>'
    print '<html lang="en">'
    print '<h1>Content not found.</h1>'
    print '</html>'