Index of the webkit module
-
m
paste.webkit
...
-
a
wkservlet
...
-
m
templates
...
-
m
wksession
...
- The WebKit session object; an interface surrounding a persistent
dictionary.
-
m
wkrequest
...
- A Webware HTTPRequest object, implemented based on the WSGI request
environment dictionary.
-
C
HTTPRequest
...
-
f
cookies
...
- Returns a dictionary-style object of all Cookie objects the
client sent with this request.
-
f
hasValue
...
-
f
protocol
...
-
f
contextPath
...
-
f
isSessionExpired
...
- Returns bool: whether or not this request originally
contained an expired session ID. Only works if the
Application.config setting "IgnoreInvalidSession" is set to 1;
otherwise you get a canned error page on an invalid session,
so your servlet never gets processed.
-
f
pathInfo
...
-
f
serverURLDir
...
-
f
hasCookie
...
-
f
urlPath
...
-
f
serverSideContextPath
...
-
f
fsPath
...
-
f
setField
...
-
f
originalURLPath
...
-
f
__init__
...
-
f
uriWebKitRoot
...
-
f
rawRequest
...
-
f
delField
...
-
f
adapterName
...
- Returns the name of the adapter as it appears in the URL.
Example: '/WebKit.cgi'
This is useful in special cases when you are constructing URLs. See Testing/Main.py for an example use.
-
f
remoteUser
...
- Always returns None since authentication is not yet
supported. Take from CGI variable REMOTE_USER.
-
f
fieldStorage
...
-
f
setTransaction
...
-
f
remoteName
...
- Returns the fully qualified name of the client that sent
the request, or the IP address of the client if the name
cannot be determined.
-
f
field
...
-
f
rawInput
...
- This gives you a file-like object for the data that was
sent with the request (e.g., the body of a POST request,
or the documented uploaded in a PUT request).
-
f
environ
...
-
f
uri
...
- Returns the request URI, which is the entire URL except
for the query string.
-
f
config
...
-
f
contextName
...
-
f
servletPathFromSiteRoot
...
-
f
queryString
...
- Returns the query string portion of the URL for this
request. Taken from the CGI variable QUERY_STRING.
-
f
extraURLPath
...
-
f
serverURL
...
-
f
setSessionExpired
...
-
f
siteRootFromCurrentServlet
...
-
f
serverSidePath
...
-
f
cookie
...
- Returns the value of the specified cookie.
-
f
servletPath
...
-
f
servletURI
...
- This is the URI of the servlet, without any query strings or extra path info
-
f
method
...
- Returns the HTTP request method (in all uppercase), typically
from the set GET, POST, PUT, DELETE, OPTIONS and TRACE.
-
f
timeStamp
...
-
f
info
...
-
f
serverDictionary
...
- Returns a dictionary with the data the web server gave us,
like HTTP_HOST or HTTP_USER_AGENT.
-
f
getstate
...
-
f
siteRoot
...
-
f
setURLPath
...
-
f
fields
...
-
f
remoteAddress
...
- Returns a string containing the Internet Protocol (IP)
address of the client that sent the request.
-
f
pathTranslated
...
-
f
value
...
-
f
htmlInfo
...
-
f
urlPathDir
...
-
f
sessionId
...
- Returns a string with the session id specified by the
client, or None if there isn't one.
-
f
session
...
- Returns the session associated with this request, either
as specified by sessionId() or newly created. This is a
convenience for transaction.session()
-
f
hasField
...
-
f
time
...
-
f
transaction
...
-
m
wkapplication
...
- A mostly dummy class to simulate the Webware Application object.
-
m
wsgiapp
...
-
m
FakeWebware
...
-
m
WebKit
...
-
m
WebUtils
...
-
m
Funcs
...
- WebUtils.Funcs provides some basic functions that are useful in HTML and web development.
-
a
HTMLCodesReversed
...
-
a
c
...
-
a
HTMLCodes
...
-
a
i
...
-
f
URLEncode
...
-
f
htmlForDict
...
- Returns an HTML string with a <table> where each row is a key-value pair.
-
f
HTMLEncode
...
-
f
URLDecode
...
-
f
RequestURI
...
-
f
htmlEncode
...
- Returns the HTML encoded version of the given string. This is useful to display a plain ASCII text string on a web page.
-
f
normURL
...
- Normalizes a URL path, like os.path.normpath, but acts on
a URL independant of operating system environmant.
-
f
urlEncode
...
- Returns the encoded version of the given string, safe for using as a URL.
-
f
requestURI
...
- Returns the request URI for a given CGI-style dictionary. Uses REQUEST_URI if available, otherwise constructs and returns it from SCRIPT_NAME, PATH_INFO and QUERY_STRING.
-
f
htmlDecode
...
- Returns the ASCII decoded version of the given HTML string. This does NOT remove normal HTML tags like <p>. It is the inverse of htmlEncode().
-
f
HTMLForDictionary
...
-
f
urlDecode
...
- Returns the decoded version of the given string. Note that invalid URLs will throw exceptons. For example, a URL whose % coding is incorrect.
-
f
HTMLDecode
...
-
m
TaskKit
...
-
f
InstallInWebKit
...
-
m
Tests
...
-
m
Scheduler
...
- This is the TaskManager python package. It provides a system for running any number of
predefined tasks in separate threads in an organized and controlled manner.
-
C
Scheduler
...
- The top level class of the TaskManager system. The Scheduler is a thread that
handles organizing and running tasks. The Sheduler class should be instantiated
to start a TaskManager sessions. It's run method should be called to start the
TaskManager. It's stop method should be called to end the TaskManager session.
-
f
addDailyAction
...
- This method is used to add an action to be run every day at a specific time.
If a task with the given name is already registered with the scheduler, that task
will be removed from the scheduling queue and registered anew as a periodic task.
-
f
runTaskNow
...
- This method is provided to allow a registered task to be immediately executed.
-
f
runningTasks
...
-
f
delOnDemand
...
- Deleted a task with the given name from the onDemand list.
-
f
hasOnDemand
...
- Is the task with he given name in the onDemand list?
-
f
notify
...
-
f
stopTask
...
- This method is provided to put an immediate halt to a running background task.
-
f
__init__
...
-
f
stopAllTasks
...
- Terminate all running tasks.
-
f
nextTime
...
-
f
setScheduled
...
- Add the given task to the scheduled list.
-
f
onDemand
...
- Returns a task from the onDemand list.
-
f
enableTask
...
- This method is provided to specify that a task be re-enabled after a suspension.
A re-enabled task will be scheduled for execution according to its original schedule,
with any runtimes that would have been issued during the time the task was suspended
simply skipped.
-
f
run
...
- This method is responsible for carrying out the scheduling work of this class
on a background thread. The basic logic is to wait until the next action is due to
run, move the task from our scheduled list to our running list, and run it. Other
synchronized methods such as runTask(), scheduleTask(), and notifyCompletion(), may
be called while this method is waiting for something to happen. These methods modify
the data structures that run() uses to determine its scheduling needs.
-
f
hasRunning
...
- Check to see if a task with the given name is currently running.
-
f
onDemandTasks
...
-
f
disableTask
...
- This method is provided to specify that a task be suspended. Suspended tasks will
not be scheduled until later enabled. If the task is currently running, it will
not be interfered with, but the task will not be scheduled for execution in future
until re-enabled.
-
f
setRunning
...
- Add a task to the running dictionary.
Used internally only.
-
f
scheduled
...
- Returns a task from the scheduled list.
-
f
notifyCompletion
...
- This method is used by instances of TaskHandler to let the Scheduler thread know
when their tasks have run to completion.
This method is responsible for rescheduling the task if it is a periodic task.
-
f
setNextTime
...
-
f
delScheduled
...
- Deleted a task with the given name from the scheduled list.
-
f
setOnDemand
...
- Add the given task to the onDemand list.
-
f
stop
...
- This method terminates the scheduler and its associated tasks.
-
f
scheduledTasks
...
-
f
demandTask
...
- This method is provided to allow the server to request that a task listed as being
registered on-demand be run as soon as possible.
-
f
running
...
- Returns a task with the given name from the "running" list,
if it is present there.
-
f
runTask
...
- This method is used by the Scheduler thread's main loop to put a task in
the scheduled hash onto the run hash.
-
f
addTimedAction
...
- This method is used to add an action to be run once, at a specific time.
-
f
scheduleTask
...
- This method takes a task that needs to be scheduled and adds it to the scheduler.
All scheduling additions or changes are handled by this method. This is the only
Scheduler method that can notify the run() method that it may need to wake up early
to handle a newly registered task.
-
f
hasScheduled
...
- Is the task with he given name in the scheduled list?
-
f
wait
...
- Our own version of wait.
When called, it waits for the specified number of seconds, or until it is
notified that it needs to wake up, through the notify event.
-
f
isRunning
...
-
f
unregisterTask
...
- This method unregisters the named task so that it can be rescheduled with
different parameters, or simply removed.
-
f
addPeriodicAction
...
- This method is used to add an action to be run at a specific initial time,
and every period thereafter.
-
f
addActionOnDemand
...
- This method is used to add a task to the scheduler that will not be scheduled
until specifically requested.
-
f
delRunning
...
- Delete a task from the running list.
Used Internally.
-
m
TaskHandler
...
-
C
TaskHandler
...
- While the Task class only knows what task to perform with the run()-method,
the TaskHandler has all the knowledge about the periodicity of the task.
Instances of this class are managed by the Scheduler in the
scheduled, running and onDemand dictionaries.
-
f
reset
...
-
f
notifyCompletion
...
-
f
runTask
...
- Runs this task in a background thread.
-
f
enable
...
- Method to enable future invocations of this task.
-
f
isRunning
...
-
f
name
...
-
f
unregister
...
- Method to request that this task not be kept after its current completion.
Used to remove a task from the scheduler
-
f
stop
...
-
f
period
...
- Returns the period of this task.
-
f
runAgain
...
- This method lets the Scheduler check to see whether this task should be
re-run when it terminates
-
f
setPeriod
...
- Mmethod to change the period for this task.
-
f
reschedule
...
- Method to determine whether this task should be rescheduled. Increments the
startTime and returns true if this is a periodically executed task.
-
f
disable
...
- Method to disable future invocations of this task.
-
f
startTime
...
-
f
isOnDemand
...
- Returns true if this task is not scheduled for periodic execution.
-
f
__init__
...
-
f
runOnCompletion
...
- Method to request that this task be re-run after its current completion.
Intended for on-demand tasks that are requested by the Scheduler while
they are already running.
-
m
Properties
...
-
m
MiscUtils
...
-
m
Funcs
...
- Funcs.py
-
a
True
...
-
f
charWrap
...
- Returns a new version of the string word wrapped with the given width and hanging indent. The font is assumed to be monospaced.
This can be useful for including text between <pre> </pre> tags since <pre> will not word wrap and for lengthly lines, will increase the width of a web page.
It can also be used to help delineate the entries in log-style output by passing hanging=4.
-
f
wordWrap
...
- Returns a version of the string word wrapped to the given width.
Respects existing newlines in the string.
-
f
dateForEmail
...
- Returns a properly formatted date/time string for email messages
-
f
commas
...
- Returns the given number as a string with commas to separate the thousands positions. The number can be a float, int, long or string. Returns None for None.
-
f
CharWrap
...
-
f
localIP
...
- Gets the "public" address of the local machine, i.e. that address
which is connected to the general Internet.
-
f
uniqueId
...
- Generates an opaque, identifier string that is practically guaranteed to be unique.
If an object is passed, then its id() is incorporated into the generation.
Relies on md5 and returns a 32 character long string.
-
f
valueForString
...
- For a given string, returns the most appropriate Pythonic value
such as None, a long, an int, a list, etc. If none of those
make sense, then returns the string as-is.
-
f
hostName
...
- Returns the host name which is taken first from the os environment and failing that, from the 'hostname' executable. May return None if neither attempt succeeded.
The environment keys checked are HOST and HOSTNAME both upper and lower case.
-
f
timestamp
...
- Returns a dictionary of timestamp versions.
-
f
Commas
...
-
f
safeDescription
...
- Returns the repr() of x and its class (or type) for help in
debugging. A major benefit here is that exceptions from
repr() are consumed. This is important in places like
"assert" where you don't want to lose the assertion
exception in your attempt to get more information.
-
m
DictForArgs
...
- DictForArgs.py
-
m
DBPool
...
- DBPool.py
-
m
MixIn
...
-
f
MixIn
...
- Mixes in the attributes of the mixInClass into the pyClass. These attributes are typically methods (but don't have to be). Note that private attributes, denoted by a double underscore, are not mixed in. Collisions are resolved by the mixInClass' attribute overwriting the pyClass'. This gives mix-ins the power to override the behavior of the pyClass.
-
m
Error
...
-
C
Error
...
- An error is a dictionary-like object, containing a specific user-readable error message and an object associated with it. Since Error inherits UserDict, other informative values can be arbitrarily attached to errors. For this reason, subclassing Error is rare.
-
f
message
...
-
f
__init__
...
- Initializes an error with the object the error occurred for, and the user-readable error message. The message should be self sufficient such that if printed by itself, the user would understand it.
-
f
object
...
-
f
__nonzero__
...
-
m
DataTable
...
- DataTable.py
-
m
PropertiesObject
...
-
C
WillNotRunError
...
-
C
PropertiesObject
...
- A PropertiesObject represents, in a dictionary-like fashion,
the values found in a Properties.py file. That file is always
included with a Webware component to advertise its name,
version, status, etc. Note that a Webware component is a
Python package that follows additional conventions. Also, the
top level Webware directory contains a Properties.py.
-
m
examples
...
-
m
wkcommon
...
-
m
servlet_script
...