def __init__(self): with open(os.path.join(TEMPLATES_PATH, 'periodic.html'), 'r') as periodic_file: periodic_table = periodic_file.read() PopupModule.__init__(self, popup_content=periodic_table, button_label='Select Element', styles=[os.path.join(STYLES_PATH, 'periodic.css')], scripts=[os.path.join(SCRIPTS_PATH, 'periodic.js')])
def __init__(self): with open(os.path.join(TEMPLATES_PATH, 'periodic.html'), 'r') as periodic_file: periodic_table = periodic_file.read() PopupModule.__init__( self, popup_content=periodic_table, button_label='Select Element', styles=[os.path.join(STYLES_PATH, 'periodic.css')], scripts=[os.path.join(SCRIPTS_PATH, 'periodic.js')])
def __init__(self): self.handle = None with open(os.path.join(TEMPLATES_PATH, 'BLOBHoster.html'), 'r') as blobhoster_file: blobhoster = blobhoster_file.read() template = Template(blobhoster) context = Context({'form': BLOBHosterForm()}) popup_content = template.render(context) PopupModule.__init__(self, popup_content=popup_content, button_label='Upload File', scripts=[os.path.join(SCRIPTS_PATH, 'blobhoster.js')])
def __init__(self): scripts = [os.path.join(SCRIPTS_PATH, 'handle.js')] styles = [] popup_content = "<p style='color:red;'>" popup_content += "Warning: You are about to request an handle for this document.<br/>" popup_content += "Clicking on 'Save' will generate a request to the Handle System." popup_content += "A unique handle will be created for this document and it will be registered on the Handle System." popup_content += "</p>" button_label = "Get a unique handle" PopupModule.__init__(self, scripts, styles, popup_content, button_label)
def __init__(self): self.table = None self.table_name = None with open(os.path.join(TEMPLATES_PATH, 'ExcelUploader.html'), 'r') as excel_uploader_file: excel_uploader = excel_uploader_file.read() template = Template(excel_uploader) context = Context({'form': ExcelUploaderForm()}) popup_content = template.render(context) PopupModule.__init__(self, popup_content=popup_content, button_label='Upload Excel File', scripts=[os.path.join(SCRIPTS_PATH, 'exceluploader.js')], styles=[os.path.join(STYLES_PATH, 'exceluploader.css')])
def __init__(self): self.handle = None with open(os.path.join(TEMPLATES_PATH, 'BLOBHoster.html'), 'r') as blobhoster_file: blobhoster = blobhoster_file.read() template = Template(blobhoster) context = Context({'form': BLOBHosterForm()}) popup_content = template.render(context) PopupModule.__init__( self, popup_content=popup_content, button_label='Upload File', scripts=[os.path.join(SCRIPTS_PATH, 'blobhoster.js')])
def _get_module(self, request): if 'data' in request.GET: if len(request.GET['data']) > 0: xml_table = etree.fromstring("<table>" + request.GET['data'] + "</table>") self.table_name = 'name' self.table = { 'headers': [], 'values': [] } headers = xml_table[0] for header in headers.iter('column'): self.table['headers'].append(header.text) values = xml_table[1] for row in values.iter('row'): value_list = [] for data in row.iter('column'): value_list.append(data.text) self.table['values'].append(value_list) return PopupModule.get_module(self, request)
def _get_module(self, request): if 'data' in request.GET: if len(request.GET['data']) > 0: xml_table = etree.XML(request.GET['data']) self.table_name = 'name' self.table = {'headers': [], 'values': []} headers = xml_table[0] for header in headers.iter('column'): print etree.tostring(header) self.table['headers'].append(header.text) values = xml_table[1] for row in values.iter('row'): value_list = [] for data in row.iter('column'): value_list.append(data.text) self.table['values'].append(value_list) print self.table_name print self.table return PopupModule.get_module(self, request)
def __init__(self): self.table = None self.table_name = None with open(os.path.join(TEMPLATES_PATH, 'ExcelUploader.html'), 'r') as excel_uploader_file: excel_uploader = excel_uploader_file.read() template = Template(excel_uploader) context = Context({'form': ExcelUploaderForm()}) popup_content = template.render(context) PopupModule.__init__( self, popup_content=popup_content, button_label='Upload Excel File', scripts=[os.path.join(SCRIPTS_PATH, 'exceluploader.js')], styles=[os.path.join(STYLES_PATH, 'exceluploader.css')])
def _get_module(self, request): return PopupModule.get_module(self, request)
def _get_module(self, request): self.handle = "" if 'data' in request.GET: self.handle = request.GET['data'] return PopupModule.get_module(self, request)