def run(argv): bauerGlobals = BauerGlobals() setupLogging(argv) generatorInfo = GeneratorInfo() argParser = BauerArgParser(bauerGlobals, generatorInfo) argParser.buildBauerArguments(argv) args = argParser.parse_args() if args == None: return if args.command == 'new': templateCreator = TemplateCreator() templateCreator.generate(args) return if args.command == 'doc': doccer = Documentation() doccer.run(args) return rootPath = os.path.abspath( os.path.join(os.path.realpath(__file__), "..", "..")) source_folder = os.getcwd() buildFolder = BuildFolder(bauerGlobals, generatorInfo, source_folder, args) commandProcessor = CommandProcessor(bauerGlobals, generatorInfo, args, rootPath, source_folder, buildFolder) commandProcessor.process()
class Client(TwistedClient): documentation = Documentation() THEMES = { # Matching theme names with Theme instances. TwistedClient.DEFAULTTHEME: documentation, 'documentation': documentation, 'doc': documentation, }
def run(argv): bauerGlobals = BauerGlobals() setupLogging(argv) generatorInfo = GeneratorInfo() argParser = BauerArgParser(bauerGlobals, generatorInfo) argParser.buildBauerArguments(argv) args = argParser.parse_args() if args == None: return if args.command == 'new': templateCreator = TemplateCreator() templateCreator.generate(args) return if args.command == 'doc': doccer = Documentation() doccer.run(args) return rootPath = os.path.abspath( os.path.join(os.path.realpath(__file__), "..", "..")) source_folder = os.getcwd() # Python will switch to the real path when the working dir has a symlink in it. # We'll update the current dir and the environment variable to reflect this. os.chdir(source_folder) os.environ["PWD"] = source_folder buildFolder = BuildFolder(bauerGlobals, generatorInfo, source_folder, args) commandProcessor = CommandProcessor(bauerGlobals, generatorInfo, args, rootPath, source_folder, buildFolder) commandProcessor.process()
from flask import Flask, render_template, redirect, abort from documentation import Documentation from lxml import html from werkzeug.contrib.cache import SimpleCache DEFAULT_VERSION = '0.12' app = Flask(__name__, static_url_path='') docs = Documentation(SimpleCache()) @app.route('/') def welcome(): return render_template('welcome.html', current_version=DEFAULT_VERSION) @app.route('/docs/') def show_root_page(): return redirect('/docs/' + DEFAULT_VERSION) @app.route('/docs/<version>/') @app.route('/docs/<version>/<page>') def show(version, page=None): if not is_version(version): return redirect('/docs/' + DEFAULT_VERSION + '/' + version, 301) if not page: page = ''
def __init__(self, soup): self._soup = soup self._documentation = Documentation()