ShellBanner
System:Linux MiraNet 3.0.0-14-generic-pae #23-Ubuntu SMP Mon Nov 21 22:07:10 UTC 2011 i686
Software:Apache. PHP/5.3.6-13ubuntu3.10
ID:uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
Safe Mode:OFF
Open_Basedir:OFF
Freespace:22.83 GB of 70.42 GB (32.42%)
MySQL: ON MSSQL: OFF Oracle: OFF PostgreSQL: OFF Curl: OFF Sockets: ON Fetch: OFF Wget: ON Perl: ON
Disabled Functions: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,

/ usr/ share/ pyshared/ zope/ interface/ - drwxr-xr-x

Directory:
Viewing file:     document.py (3.45 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
""" Pretty-Print an Interface object as structured text (Yum)

This module provides a function, asStructuredText, for rendering an
interface as structured text.

$Id: document.py 110536 2010-04-06 02:59:44Z tseaver $
"""
import zope.interface

def asStructuredText(I, munge=0):
    """ Output structured text format.  Note, this will whack any existing
    'structured' format of the text.  """

    r = [I.getName()]
    outp = r.append
    level = 1

    if I.getDoc():
        outp(_justify_and_indent(_trim_doc_string(I.getDoc()), level))

    bases = [base
             for base in I.__bases__
             if base is not zope.interface.Interface
             ]
    if bases:
        outp(_justify_and_indent("This interface extends:", level, munge))
        level += 1
        for b in bases:
            item = "o %s" % b.getName()
            outp(_justify_and_indent(_trim_doc_string(item), level, munge))
        level -= 1

    namesAndDescriptions = I.namesAndDescriptions()
    namesAndDescriptions.sort()

    outp(_justify_and_indent("Attributes:", level, munge))
    level += 1
    for name, desc in namesAndDescriptions:
        if not hasattr(desc, 'getSignatureString'):   # ugh...
            item = "%s -- %s" % (desc.getName(),
                                 desc.getDoc() or 'no documentation')
            outp(_justify_and_indent(_trim_doc_string(item), level, munge))
    level -= 1

    outp(_justify_and_indent("Methods:", level, munge))
    level += 1
    for name, desc in namesAndDescriptions:
        if hasattr(desc, 'getSignatureString'):   # ugh...
            item = "%s%s -- %s" % (desc.getName(),
                                   desc.getSignatureString(),
                                   desc.getDoc() or 'no documentation')
            outp(_justify_and_indent(_trim_doc_string(item), level, munge))

    return "\n\n".join(r) + "\n\n"


def _trim_doc_string(text):
    """ Trims a doc string to make it format
    correctly with structured text. """

    lines = text.replace('\r\n', '\n').split('\n')
    nlines = [lines.pop(0)]
    if lines:
        min_indent = min([len(line) - len(line.lstrip())
                          for line in lines])
        for line in lines:
            nlines.append(line[min_indent:])

    return '\n'.join(nlines)


def _justify_and_indent(text, level, munge=0, width=72):
    """ indent and justify text, rejustify (munge) if specified """

    indent = " " * level

    if munge:
        lines = []
        line = indent
        text = text.split()

        for word in text:
            line = ' '.join([line, word])
            if len(line) > width:
                lines.append(line)
                line = indent
        else:
            lines.append(line)

        return '\n'.join(lines)

    else:
        return indent + \
            text.strip().replace("\r\n", "\n") .replace("\n", "\n" + indent)
Command:
Quick Commands:
Upload:
[Read-Only] Max size: 100MB
PHP Filesystem: <@ Ú
Search File:
regexp
Create File:
Overwrite [Read-Only]
View File:
Mass Defacement:
[+] Main Directory: [+] Defacement Url:
LmfaoX Shell - Private Build [BETA] - v0.1 -; Generated: 0.2702 seconds