source: companies/celepar/news_admin/templates/celepar/fckeditor/to_delete/_samples/py/sample01.py @ 763

Revision 763, 1.9 KB checked in by niltonneto, 15 years ago (diff)

Importação inicial do Expresso da Celepar

Line 
1#!/usr/bin/env python
2
3"""
4FCKeditor - The text editor for internet
5Copyright (C) 2003-2006 Frederico Caldeira Knabben
6
7Licensed under the terms of the GNU Lesser General Public License:
8                http://www.opensource.org/licenses/lgpl-license.php
9
10For further information visit:
11                http://www.fckeditor.net/
12
13"Support Open Source software. What about a donation today?"
14
15File Name: sample01.py
16        Sample page.
17
18File Authors:
19                Andrew Liu (andrew@liuholdings.com)
20"""
21
22import cgi
23import os
24
25# Ensure that the fckeditor.py is included in your classpath
26import fckeditor
27
28# Tell the browser to render html
29print "Content-Type: text/html"
30print ""
31
32# Document header
33print """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
34<html>
35        <head>
36                <title>FCKeditor - Sample</title>
37                <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
38                <meta name="robots" content="noindex, nofollow">
39                <link href="../sample.css" rel="stylesheet" type="text/css" />
40        </head>
41        <body>
42                <h1>FCKeditor - Python - Sample 1</h1>
43                This sample displays a normal HTML form with an FCKeditor with full features
44                enabled.
45                <hr>
46                <form action="sampleposteddata.py" method="post" target="_blank">
47"""
48
49# This is the real work
50try:
51        sBasePath = os.environ.get("SCRIPT_NAME")
52        sBasePath = sBasePath[0:sBasePath.find("_samples")]
53
54        oFCKeditor = fckeditor.FCKeditor('FCKeditor1')
55        oFCKeditor.BasePath = sBasePath
56        oFCKeditor.Value = """This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>."""
57        print oFCKeditor.Create()
58except Exception, e:
59        print e
60print """
61                        <br>
62                        <input type="submit" value="Submit">
63                </form>
64"""
65
66# For testing your environments
67print "<hr>"
68for key in os.environ.keys():
69        print "%s: %s<br>" % (key, os.environ.get(key, ""))
70print "<hr>"
71
72# Document footer
73print """
74        </body>
75</html>
76"""
77
78
Note: See TracBrowser for help on using the repository browser.