parameters: ()
return_statement: return dict(form=form,form_widget=form_widget,doc=doc,
                  widget_code=widget_code)
docstring: >> inspect.getargspec(PluginWikiWidgets.tags)
      (['table', 'record_id'], None, None, ('None', None))
      >>> dir(PluginWikiWidgets)
docstring_summary: >> inspect.getargspec(PluginWikiWidgets.tags)
      (['table', 'record_id'], None, None, ('None', None))
      >>> dir(PluginWikiWidgets)
docstring_tokens: >> inspect . getargspec ( PluginWikiWidgets . tags ) ( [ table record_id ] None None ( None None )) >>> dir ( PluginWikiWidgets )
function: def widget_builder():
      """
      >> inspect.getargspec(PluginWikiWidgets.tags)
      (['table', 'record_id'], None, None, ('None', None))
      >>> dir(PluginWikiWidgets)
      """
      import inspect
      name=request.vars.name
      if plugin_wiki_widgets=='all':
          widgets = ['']+[item for item in dir(PluginWikiWidgets) if item[0]!='_']
      else:
          widgets = plugin_wiki_widgets
      form=FORM(LABEL('Widget Name: '), SELECT(_name='name',value=name,
                       _onchange="jQuery(this).parent().submit()",*widgets))
      widget_code=''
      if name in widgets: 
          a,b,c,d=inspect.getargspec(getattr(PluginWikiWidgets,name))
          a,d=a or [],d or []
          null = lambda:None
          d=[null]*(len(a)-len(d))+[x for x in d]
          ESC='x'
          fields = [Field(ESC+a[i],label=a[i],default=d[i]!=null and d[i] or '',
                          requires=(d[i]==null) and IS_NOT_EMPTY() or None,
                          comment=(d[i]==null) and 'required' or '') \
                        for i in range(len(a))]
          form_widget=SQLFORM.factory(hidden=dict(name=name),*fields)
          doc = getattr(PluginWikiWidgets,name).func_doc or ''
          if form_widget.accepts(request):
              keys=['name: %s' % request.vars.name]
              for name in a:
                  if request.vars[ESC+name]:
                      keys.append(name+': %s' % request.vars[ESC+name])
              widget_code=CODE('``\n%s\n``:widget' % '\n'.join(keys))
      else:
          doc=''
          form_widget=''
      return dict(form=form,form_widget=form_widget,doc=doc,
                  widget_code=widget_code)
function_tokens: def widget_builder ( ) : import inspect name = request . vars . name if plugin_wiki_widgets == 'all' : widgets = [ '' ] + [ item for item in dir ( PluginWikiWidgets ) if item [ 0 ] != '_' ] else : widgets = plugin_wiki_widgets form = FORM ( LABEL ( 'Widget Name: ' ) , SELECT ( _name = 'name' , value = name , _onchange = "jQuery(this).parent().submit()" , * widgets ) ) widget_code = '' if name in widgets : a , b , c , d = inspect . getargspec ( getattr ( PluginWikiWidgets , name ) ) a , d = a or [ ] , d or [ ] null = lambda : None d = [ null ] * ( len ( a ) - len ( d ) ) + [ x for x in d ] ESC = 'x' fields = [ Field ( ESC + a [ i ] , label = a [ i ] , default = d [ i ] != null and d [ i ] or '' , requires = ( d [ i ] == null ) and IS_NOT_EMPTY ( ) or None , comment = ( d [ i ] == null ) and 'required' or '' ) for i in range ( len ( a ) ) ] form_widget = SQLFORM . factory ( hidden = dict ( name = name ) , * fields ) doc = getattr ( PluginWikiWidgets , name ) . func_doc or '' if form_widget . accepts ( request ) : keys = [ 'name: %s' % request . vars . name ] for name in a : if request . vars [ ESC + name ] : keys . append ( name + ': %s' % request . vars [ ESC + name ] ) widget_code = CODE ( '``\n%s\n``:widget' % '\n' . join ( keys ) ) else : doc = '' form_widget = '' return dict ( form = form , form_widget = form_widget , doc = doc , widget_code = widget_code )