Exemplo n.º 1
0
 def hostsPageContent(self, MenuStatusMSG, ShowCancelButton):
     tempText = '<body bgcolor=\"#666666\" text=\"#FFFFFF\">\n'
     tempText += IncludeMENU(MenuStatusMSG, ShowCancelButton)
     tempText += '<div class="main"><table border="0" cellspacing="50px"><tbody>\n<tr>'
     columnIndex = 1
     displayHostsList = SortHostsList(GetHostsList())
     if 0 == len(GetHostsOrderList()):
         try:
             displayHostsList.sort(key=lambda t: tuple('.'.join(
                 str(t[0]).replace('://', '.').replace('www.', '').split(
                     '.')[1:-1]).lower()))
         except Exception as e:
             print("Exception during sorting displayHostsList", str(e))
     for hostName in displayHostsList:
         if hostName in settings.activeHostsHTML.keys():
             hostHTML = settings.activeHostsHTML[hostName]
             tempText += hostHTML
             #tempText += '<td><button type="button" disabled>%s</button> </td>' % _('Enter')
             columnIndex += 1
             if columnIndex > 4:
                 columnIndex = 1
                 tempText += '</tr>\n<tr>'
     tempText += '</tr>'
     tempText += '</tbody></table></div></body>\n'
     return tempText
Exemplo n.º 2
0
	def hostsPageContent(self, MenuStatusMSG, ShowCancelButton):
		tempText = '<body bgcolor=\"#666666\" text=\"#FFFFFF\">\n'
		tempText += IncludeMENU(MenuStatusMSG, ShowCancelButton)
		tempText += '<div class="main"><table border="0" cellspacing="50px"><tbody>\n<tr>'
		columnIndex = 1
		displayHostsList = SortHostsList(GetHostsList())
		if 0 == len(GetHostsOrderList()):
			try:
				displayHostsList.sort(key=lambda t: tuple('.'.join(str(t[0]).replace('://', '.').replace('www.', '').split('.')[1:-1]).lower()))
			except Exception, e:
				print "Exception during sorting displayHostsList", str(e)