K2LL33D SHELL

 Apache/2.4.7 (Ubuntu)
 Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64
 uid=33(www-data) gid=33(www-data) groups=33(www-data)
 safemode : OFF
 MySQL: ON | Perl: ON | cURL: OFF | WGet: ON
  >  / usr / lib / python2.7 / dist-packages / twisted / scripts /
server ip : 172.67.156.115

your ip : 172.70.179.170

H O M E


Filename/usr/lib/python2.7/dist-packages/twisted/scripts/htmlizer.py
Size1.75 kb
Permissionrw-r--r--
Ownerroot : root
Create time27-Apr-2025 09:56
Last modified18-Oct-2011 18:31
Last accessed06-Jul-2025 17:14
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.

#

"""HTML pretty-printing for Python source code."""

__version__ = '$Revision: 1.8 $'[11:-2]

from twisted.python import htmlizer, usage
from twisted import copyright

import os, sys

header = '''<html><head>
<title>%(title)s</title>
<meta name=\"Generator\" content="%(generator)s" />
%(alternate)s
%(stylesheet)s
</head>
<body>
'''
footer = """</body>"""

styleLink = '<link rel="stylesheet" href="%s" type="text/css" />'
alternateLink = '<link rel="alternate" href="%(source)s" type="text/x-python" />'

class Options(usage.Options):
synopsis = """%s [options] source.py
""" % (
os.path.basename(sys.argv[0]),)

optParameters = [
('stylesheet', 's', None, "URL of stylesheet to link to."),
]

compData = usage.Completions(
extraActions=[usage.CompleteFiles('*.py', descr='source python file')]
)

def parseArgs(self, filename):
self['filename'] = filename

def run():
options = Options()
try:
options.parseOptions()
except usage.UsageError, e:
print str(e)
sys.exit(1)
filename = options['filename']
if options.get('stylesheet') is not None:
stylesheet = styleLink % (options['stylesheet'],)
else:
stylesheet = ''

output = open(filename + '.html', 'w')
try:
output.write(header % {
'title': filename,
'generator': 'htmlizer/%s' % (copyright.longversion,),
'alternate': alternateLink % {'source': filename},
'stylesheet': stylesheet
})
htmlizer.filter(open(filename), output,
htmlizer.SmallerHTMLWriter)
output.write(footer)
finally:
output.close()