示例#1
0
    def POST(self):
        formInput = web.input(docableFile={})
        # If we get the file via AJAX, it doesn't fill in the filename and such
        # properly.  Instead, the first part of the file contents is used as
        # the key. *shrug*
        if formInput["docableFile"] == {}:
            # pycco barfs if there's no file extension...
            filename = "unknown.filename"
            code = formInput.keys()[0] + formInput[formInput.keys()[0]]
        else:
            filename = formInput["docableFile"].filename
            code = formInput["docableFile"].value

        if filename == "":
            return "Please submit a file."

        documentedSource = generate_documentation(filename, code)
        return documentedSource
示例#2
0
def test_generate_documentation():
    p.generate_documentation(PYCCO_SOURCE, outdir=tempfile.gettempdir())
示例#3
0
def test_generate_documentation():
    p.generate_documentation(PYCCO_SOURCE, outdir=tempfile.gettempdir())