コード例 #1
0
ファイル: cmd_docs_js.py プロジェクト: Amadiro/devilry-django
            print 'Opening in browser'
            webbrowser.open_new_tab('file:///' + indexpath)
    else:
        print "JSDuck exited with error code {}.".format(retcode)


def clean(outdir):
    if exists(outdir):
        print "Removing", outdir
        rmtree(outdir)
    else:
        print "Not cleaning", outdir, "because it does not exist."



epilog = 'Example: {prog} --clean'.format(prog=getprogname())
description = """{currenthelp}

Requires JSDuck: https://github.com/nene/jsduck

Make sure you install with (notice --pre):

    $ [sudo] gem install --pre jsduck

To get the latest version of jsduck. If you get docs with the same look and
feel as the official ExtJS docs, you have the correct version of JSDuck.
"""
parser = DevilryAdmArgumentParser(description=description,
                                  epilog=epilog,
                                  formatter_class=RawDescriptionHelpFormatter)
parser.add_argument('--nobuild', action='store_true',
コード例 #2
0
help_epilog = """
Examples
--------

Create PDF class diagram:
   {prog} --cls -o cls.dot && dot -Tpng -o cls.png cls.dot

Create PDF database diagram with all details:
   {prog} --show-fields -o db.dot && dot -Tpdf -o db.pdf db.dot

Create PNG class diagram with all details:
   {prog} --cls --show-fields -o cls.dot && dot -Tpng -o cls.png cls.dot

Create PNG and choose maximum size:
    {prog} -o db.dot --height 2000 --width 550 && dot -Tpng -o db.png db.dot
""".format(prog=getprogname())


default_filter = '^(devilry\.apps\.core\.models\.|django\.contrib\.auth\.models\.User).*$'
p = CustOptParser(
        usage = "%prog [options] <outfile>",
        prog = getprogname(),
        epilog = help_epilog)
p.add_option("--sphinx-format", dest="sphinx_format",
        default=False, action='store_const', const=True,
        help="Format for sphinx.")
p.add_option("--cls", dest="classdiagram",
        default=False, action='store_const', const=True,
        help="Create class diagram. Default is database diagram.")
p.add_option("--show-fields", dest="show_fields",
        default=False, action='store_const', const=True,
コード例 #3
0
help_epilog = """
Examples
--------

Create PDF class diagram:
   {prog} --cls -o cls.dot && dot -Tpng -o cls.png cls.dot

Create PDF database diagram with all details:
   {prog} --show-fields -o db.dot && dot -Tpdf -o db.pdf db.dot

Create PNG class diagram with all details:
   {prog} --cls --show-fields -o cls.dot && dot -Tpng -o cls.png cls.dot

Create PNG and choose maximum size:
    {prog} -o db.dot --height 2000 --width 550 && dot -Tpng -o db.png db.dot
""".format(prog=getprogname())

default_filter = '^(devilry\.apps\.core\.models\.|django\.contrib\.auth\.models\.User).*$'
p = CustOptParser(usage="%prog [options] <outfile>",
                  prog=getprogname(),
                  epilog=help_epilog)
p.add_option("--sphinx-format",
             dest="sphinx_format",
             default=False,
             action='store_const',
             const=True,
             help="Format for sphinx.")
p.add_option("--cls",
             dest="classdiagram",
             default=False,
             action='store_const',
コード例 #4
0
        if openbrowser:
            print 'Opening in browser'
            webbrowser.open_new_tab('file:///' + indexpath)
    else:
        print "JSDuck exited with error code {}.".format(retcode)


def clean(outdir):
    if exists(outdir):
        print "Removing", outdir
        rmtree(outdir)
    else:
        print "Not cleaning", outdir, "because it does not exist."


epilog = 'Example: {prog} --clean'.format(prog=getprogname())
description = """{currenthelp}

Requires JSDuck: https://github.com/nene/jsduck

Make sure you install with (notice --pre):

    $ [sudo] gem install --pre jsduck

To get the latest version of jsduck. If you get docs with the same look and
feel as the official ExtJS docs, you have the correct version of JSDuck.
"""
parser = DevilryAdmArgumentParser(description=description,
                                  epilog=epilog,
                                  formatter_class=RawDescriptionHelpFormatter)
parser.add_argument(