Example #1
0
    def __init__(self, main_path, **std_args):
        self.std_args = std_args

        self.main_path = abspath(main_path)

        self.debug = self.std_args.get('debug', True)
        self.logger = globby.logger.Logger(join(self.main_path, 'logs'),
                                           self.debug)

        self.project = ProjectEnvironment(
            self.main_path,
            self.std_args.get('project', 'documentation'),
            'projects',
            self.std_args.get('suffix', 'txt'),
        )
        self.theme = ThemeEnvironment(
            self.main_path, self.std_args.get('theme', 'default'), 'themes',
            self.std_args.get('template_suffix', 'tmpl'))
        self.jinja_env = JinjaEnvironment(loader=self.theme)
        #XXX clearify `charset`
        self.charset = self.std_args.get('charset', 'utf-8')
        self.accept_all = self.std_args.get('accept_all', False)

        self.pygments_style = self.std_args.get('pygments_style', 'default')

        self.builder_dct = dict([
            (x.name, x) for x in Unit.get_all(globby.builder.Builder)
        ])
        self.builder = self.builder_dct[self.std_args.get(
            'builder', 'project2html')]

        processors = globby.markup.get_all_processors()[1]
        self.markup_processor = processors[self.std_args.get(
            'markup_processor', 'woxt')]

        self.template_context = {
            'markup_processor':
            self.markup_processor,
            'suffix':
            self.project.suffix,
            'theme':
            self.theme.name,
            'debug':
            self.debug,
            'project':
            self.project.name,
            'charset':
            self.charset,
            'main_path':
            self.main_path,
            'projects_path':
            self.project.projects_path,
            'themes_path':
            self.theme.themes_path,
            'copyright': ('This page was generated with '
                          '<a href="http://globby.webshox.org">Globby</a>'),
        }

        self.css_data = {}
Example #2
0
    def __init__(self, main_path, **std_args):
        self.std_args = std_args

        self.main_path = abspath(main_path)

        self.debug = self.std_args.get('debug', True)
        self.logger = globby.logger.Logger(join(
            self.main_path, 'logs'), self.debug)

        self.project = ProjectEnvironment(
            self.main_path,
            self.std_args.get('project', 'documentation'),
            'projects',
            self.std_args.get('suffix', 'txt'),
        )
        self.theme = ThemeEnvironment(
            self.main_path,
            self.std_args.get('theme', 'default'),
            'themes',
            self.std_args.get('template_suffix', 'tmpl')
        )
        self.jinja_env = JinjaEnvironment(loader=self.theme)
        #XXX clearify `charset`
        self.charset = self.std_args.get('charset', 'utf-8')
        self.accept_all = self.std_args.get('accept_all', False)

        self.pygments_style = self.std_args.get('pygments_style', 'default')

        self.builder_dct = dict(
            [(x.name, x) for x in Unit.get_all(globby.builder.Builder)]
        )
        self.builder = self.builder_dct[
            self.std_args.get('builder', 'project2html')
        ]



        processors = globby.markup.get_all_processors()[1]
        self.markup_processor = processors[
            self.std_args.get('markup_processor', 'woxt')]

        self.template_context = {
            'markup_processor': self.markup_processor,
            'suffix':           self.project.suffix,
            'theme':            self.theme.name,
            'debug':            self.debug,
            'project':          self.project.name,
            'charset':          self.charset,
            'main_path':        self.main_path,
            'projects_path':    self.project.projects_path,
            'themes_path':      self.theme.themes_path,
            'copyright':        ('This page was generated with '
                            '<a href="http://globby.webshox.org">Globby</a>'),
        }

        self.css_data = {}
Example #3
0
     #optional arguments:
     dest = 'markup_processor',
     default = 'woxt',
     help = (N_('Choose a markup, witch to use for rendering the project'),
             N_('(it defaults to \'woxt\')'),
             N_('choose one of: %s') % ', '.join(
                         [x for x in get_all_processors()[1]])),
 ),
 Option(
     '--builder',
     dest = 'builder',
     default = 'project2html',
     help = (N_('Choose the Builder wich generates your output.'),
             N_('(it defaults to \'project2html\')'),
             N_('Choose one of: %s') % ', '.join(
             [x.name for x in Unit.get_all(Builder)]
             )),
 ),
 Option(
     #long-opt:
     '--accept_all',
     #short-opt:
     '-a',
     #optional aruguments:
     dest = 'accept_all',
     action = 'store_true',
     help = N_('accept all queries'),
 ),
 # needed to avoid an error if the user will
 # choose a language. (because it's changed
 # in an earlier state of the Globby application)
Example #4
0
     '--markup',
     #optional arguments:
     dest='markup_processor',
     default='woxt',
     help=(N_('Choose a markup, witch to use for rendering the project'),
           N_('(it defaults to \'woxt\')'), N_('choose one of: %s') %
           ', '.join([x for x in get_all_processors()[1]])),
 ),
 Option(
     '--builder',
     dest='builder',
     default='project2html',
     help=(N_('Choose the Builder wich generates your output.'),
           N_('(it defaults to \'project2html\')'),
           N_('Choose one of: %s') %
           ', '.join([x.name for x in Unit.get_all(Builder)])),
 ),
 Option(
     #long-opt:
     '--accept_all',
     #short-opt:
     '-a',
     #optional aruguments:
     dest='accept_all',
     action='store_true',
     help=N_('accept all queries'),
 ),
 # needed to avoid an error if the user will
 # choose a language. (because it's changed
 # in an earlier state of the Globby application)
 Option(