Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: auth_decorator
Fetching contributors…

Cannot retrieve contributors at this time

26 lines (20 sloc) 0.535 kb
import time
import os
## CONFIG
# Trailing slash is important.
webroot = "http://natalya.psych0tik.net/~pyBawt/"
docroot = "/home/pyBawt/public_html"
class PublicationError(Exception):
pass
def publish(content, prefix="", suffix="txt"):
name = ""
if prefix:
name += prefix + "_"
name += "%i.%s" % (time.time(), suffix)
try:
fh = open(os.path.join(docroot, name), 'w')
fh.write(content)
fh.close()
return webroot + name
except IOError:
raise PublicationError
Jump to Line
Something went wrong with that request. Please try again.