def __init__(self, key, modules, **kwargs): def key_to_url(key): return ''.join([('_', c)[c in string.letters + string.digits] for c in key]) Widget.__init__(self) # Properties self._key = key self._mods = modules active_name = cfg.get_val(self._key) # URL self._url = '/plugin_content_%s' % (key_to_url(key)) srv = get_server() if srv.use_sec_submit: self._url += '?key=%s' % (srv.sec_submit) # Widgets self.selector_widget = ComboCfg(key, modules) self.plugin = instance_plugin(active_name, key, **kwargs) # Register hidden URL for the plugin content publish(r'^/plugin_content_%s' % (key_to_url(key)), PluginInstanceProxy, key=key, modules=modules, method='POST', **kwargs)
def __init__ (self, key, modules, **kwargs): def key_to_url (key): return ''.join ([('_',c)[c in string.letters + string.digits] for c in key]) Widget.__init__ (self) # Properties self._key = key self._mods = modules active_name = cfg.get_val (self._key) # URL self._url = '/plugin_content_%s' %(key_to_url(key)) srv = get_server() if srv.use_sec_submit: self._url += '?key=%s' %(srv.sec_submit) # Widgets self.selector_widget = ComboCfg (key, modules) self.plugin = instance_plugin (active_name, key, **kwargs) # Register hidden URL for the plugin content publish (r'^/plugin_content_%s' %(key_to_url(key)), PluginInstanceProxy, key=key, modules=modules, method='POST', **kwargs)
def register (self, build_func=None, **kwargs): """Register the function used to populate the refreshable container""" self.build_func = build_func self.params = kwargs # Register the public URL publish (self.url, render_plain_html, build_func=build_func, **kwargs)
def register(self, build_func=None, **kwargs): """Register the function used to populate the refreshable container""" self.build_func = build_func self.params = kwargs # Register the public URL publish(self.url, render_plain_html, build_func=build_func, **kwargs)
def __init__ (self, callback, container, *args, **kwargs): Table.__init__ (self, *args, **kwargs) self.id = "sortablelist_%d" %(self.uniq_id) self.url = "/sortablelist_%d"%(self.uniq_id) self.container = container # Register the public URL publish (self.url, changed_handler_func, method='POST', callback=callback, key_id='%s_order'%(self.id), **kwargs)
def __init__(self, callback, container, *args, **kwargs): Table.__init__(self, *args, **kwargs) self.id = "sortablelist_%d" % (self.uniq_id) self.url = "/sortablelist_%d" % (self.uniq_id) self.container = container # Register the public URL publish(self.url, changed_handler_func, method='POST', callback=callback, key_id='%s_order' % (self.id), **kwargs)
def __init__ (self, url, props={}): Box.__init__ (self) self.url = url self.id = "downloader_%d" %(self.uniq_id) # Other GUI components self.progressbar = ProgressBar() self += self.progressbar # Register the uploader path self._url_local = "/downloader_%d_report" %(self.uniq_id) publish (self._url_local, DownloadReport, url=url) download = DownloadEntry_Factory (self.url)
def __init__ (self, callback, container, *args, **kwargs): Table.__init__ (self, *args, **kwargs) self.id = "sortablelist_%d" %(self.uniq_id) self.url = "/sortablelist_%d"%(self.uniq_id) self.container = container # Secure submit srv = get_server() if srv.use_sec_submit: self.url += '?key=%s' %(srv.sec_submit) # Register the public URL publish (r"^/sortablelist_%d"%(self.uniq_id), changed_handler_func, method='POST', callback=callback, key_id='%s_order'%(self.id), **kwargs)
def __init__(self, name, url, props={}): Box.__init__(self) self.url = url self.name = name self.id = "downloader_%s" % (name) # Other GUI components self.progressbar = ProgressBar() self += self.progressbar # Register the uploader path self._url_local = "/downloader_%s_report" % (name) publish(self._url_local, DownloadReport, url=url) download = DownloadEntry_Factory(self.url)
def __init__ (self, name, xmlrpc_func, format_func, debug=False, props=None): assert type(name) == str Widget.__init__ (self) self._url_local = '/proxy_widget_%s' %(name) # Sanity checks assert type(xmlrpc_func) in (types.FunctionType, types.MethodType, types.InstanceType) assert type(format_func) in (types.FunctionType, types.MethodType, types.InstanceType) # Register the proxy path publish (self._url_local, ProxyRequest, xmlrpc_func = xmlrpc_func, format_func = format_func, debug = debug)
def __init__ (self, props=None, params=None, direct=True): Widget.__init__ (self) self._url_local = '/uploader_widget_%d' %(self.uniq_id) if props: self.props = props else: self.props = {} self.id = 'uplodaer%d'%(self.uniq_id) handler = self.props.get('handler') target_dir = self.props.get('target_dir') # Register the uploader path publish (self._url_local, UploadRequest, handler=handler, target_dir=target_dir, params=params, direct=direct)
def __init__(self, key, modules, **kwargs): def key_to_url(key): return "".join([("_", c)[c in string.letters + string.digits] for c in key]) Widget.__init__(self) # Properties self._key = key self._mods = modules self._url = "/plugin_content_%s" % (key_to_url(key)) active_name = cfg.get_val(self._key) # Widgets self.selector_widget = ComboCfg(key, modules) self.plugin = instance_plugin(active_name, key, **kwargs) # Register hidden URL for the plugin content publish(self._url, PluginInstanceProxy, key=key, modules=modules, method="POST", **kwargs)
def __init__ (self, host, req, props=None): Box.__init__ (self) self._url_local = '/proxy_widget_%d' %(self.uniq_id) if props: self.props = props else: self.props = {} if host == None: scgi = get_scgi() host = scgi.env['HTTP_HOST'] self._async = self.props.pop('async', True) self.id = 'proxy%d'%(self.uniq_id) # Register the proxy path publish (self._url_local, ProxyRequest, host=host, req=req)
def __init__ (self, opener_widget, props={}, params=None, direct=True): Box.__init__ (self) self.id = 'ajax_upload_%d' %(self.uniq_id) self._url_local = '/ajax_upload_%d' %(self.uniq_id) self.props = props.copy() self.opener_widget = opener_widget handler = self.props.get('handler') target_dir = self.props.get('target_dir') # Widgets msg = Box ({'class': 'msg'}, RawHTML(' ')) self += opener_widget self += msg # Register the uploader path publish (self._url_local, UploadRequest, handler=handler, target_dir=target_dir, params=params, direct=direct)
def __init__(self, name, xmlrpc_func, format_func, debug=False, props={}): assert type(name) == str Widget.__init__(self) self._url_local = '/proxy_widget_%s' % (name) self.props = props.copy() # Sanity checks assert type(xmlrpc_func) in (types.FunctionType, types.MethodType, types.InstanceType) assert type(format_func) in (types.FunctionType, types.MethodType, types.InstanceType) # Register the proxy path publish(self._url_local, ProxyRequest, xmlrpc_func=xmlrpc_func, format_func=format_func, debug=debug)
def __init__(self, opener_widget, props={}, params=None, direct=True): Box.__init__(self) self.id = 'ajax_upload_%d' % (self.uniq_id) self._url_local = '/ajax_upload_%d' % (self.uniq_id) self.props = props.copy() self.opener_widget = opener_widget handler = self.props.get('handler') target_dir = self.props.get('target_dir') # Widgets msg = Box({'class': 'msg'}, RawHTML(' ')) self += opener_widget self += msg # Register the uploader path publish(self._url_local, UploadRequest, handler=handler, target_dir=target_dir, params=params, direct=direct)
def register(self, build_func=None, **kwargs): self.build_func = build_func self.params = kwargs # Register the public URL publish(self.url, render_plain_html, build_func=build_func, **kwargs)
def register (self, build_func=None, **kwargs): self.build_func = build_func self.params = kwargs # Register the public URL publish (self.url, render_plain_html, build_func=build_func, **kwargs)