From 77bf02742b0fc22c13b636e130367ed4d7b056c6 Mon Sep 17 00:00:00 2001
From: rdb
Date: Sun, 6 Dec 2015 22:36:58 +0100
Subject: [PATCH] Remove unused direct.http package
---
direct/src/http/HTMLTree.py | 19 -
direct/src/http/LandingPage.py | 188 ---------
direct/src/http/LandingPageHTML.py | 476 ---------------------
direct/src/http/WebRequest.py | 295 -------------
direct/src/http/__init__.py | 0
direct/src/http/application_log.h | 2 -
direct/src/http/baseincomingset.h | 63 ---
direct/src/http/baseincomingset.i | 202 ---------
direct/src/http/bufferedwriter_growable.h | 117 ------
direct/src/http/config_http.cxx | 46 --
direct/src/http/config_http.h | 27 --
direct/src/http/favicon.ico | Bin 3638 -> 0 bytes
direct/src/http/http_bufferedreader.h | 96 -----
direct/src/http/http_bufferedreader.i | 296 -------------
direct/src/http/http_connection.cxx | 168 --------
direct/src/http/http_connection.h | 78 ----
direct/src/http/http_request.cxx | 38 --
direct/src/http/http_request.h | 123 ------
direct/src/http/linuxSystemInfo.py | 134 ------
direct/src/http/p3http_composite1.cxx | 5 -
direct/src/http/parsedhttprequest.cxx | 214 ----------
direct/src/http/parsedhttprequest.h | 144 -------
direct/src/http/recaptcha.py | 100 -----
direct/src/http/ringbuffer_slide.h | 48 ---
direct/src/http/ringbuffer_slide.i | 187 ---------
direct/src/http/strtargetbuffer.h | 31 --
direct/src/http/webAIInspector.py | 487 ----------------------
direct/src/http/webNotifyDebug.py | 275 ------------
direct/src/http/windowsSystemInfo.py | 129 ------
makepanda/makepanda.vcproj | 20 -
30 files changed, 4008 deletions(-)
delete mode 100755 direct/src/http/HTMLTree.py
delete mode 100755 direct/src/http/LandingPage.py
delete mode 100755 direct/src/http/LandingPageHTML.py
delete mode 100755 direct/src/http/WebRequest.py
delete mode 100644 direct/src/http/__init__.py
delete mode 100644 direct/src/http/application_log.h
delete mode 100644 direct/src/http/baseincomingset.h
delete mode 100644 direct/src/http/baseincomingset.i
delete mode 100644 direct/src/http/bufferedwriter_growable.h
delete mode 100644 direct/src/http/config_http.cxx
delete mode 100644 direct/src/http/config_http.h
delete mode 100644 direct/src/http/favicon.ico
delete mode 100644 direct/src/http/http_bufferedreader.h
delete mode 100644 direct/src/http/http_bufferedreader.i
delete mode 100644 direct/src/http/http_connection.cxx
delete mode 100644 direct/src/http/http_connection.h
delete mode 100644 direct/src/http/http_request.cxx
delete mode 100644 direct/src/http/http_request.h
delete mode 100755 direct/src/http/linuxSystemInfo.py
delete mode 100644 direct/src/http/p3http_composite1.cxx
delete mode 100644 direct/src/http/parsedhttprequest.cxx
delete mode 100644 direct/src/http/parsedhttprequest.h
delete mode 100755 direct/src/http/recaptcha.py
delete mode 100644 direct/src/http/ringbuffer_slide.h
delete mode 100644 direct/src/http/ringbuffer_slide.i
delete mode 100644 direct/src/http/strtargetbuffer.h
delete mode 100755 direct/src/http/webAIInspector.py
delete mode 100755 direct/src/http/webNotifyDebug.py
delete mode 100755 direct/src/http/windowsSystemInfo.py
diff --git a/direct/src/http/HTMLTree.py b/direct/src/http/HTMLTree.py
deleted file mode 100755
index f96b5c9d05..0000000000
--- a/direct/src/http/HTMLTree.py
+++ /dev/null
@@ -1,19 +0,0 @@
-import xml.etree.ElementTree as ET
-
-class HTMLTree(ET.ElementTree):
- def __init__(self, title):
- root = ET.Element('HTML')
- ET.ElementTree.__init__(self, root)
-
- head = ET.SubElement(root, 'HEAD')
- titleTag = ET.SubElement(head, 'TITLE')
- titleTag.text = title
-
- body = ET.SubElement(root, 'BODY')
-
- def getBody(self):
- return self.find('BODY')
-
- def getHead(self):
- return self.find('HEAD')
-
diff --git a/direct/src/http/LandingPage.py b/direct/src/http/LandingPage.py
deleted file mode 100755
index 212e3a6e20..0000000000
--- a/direct/src/http/LandingPage.py
+++ /dev/null
@@ -1,188 +0,0 @@
-import os
-from direct.directnotify.DirectNotifyGlobal import directNotify
-from pandac.PandaModules import VirtualFileSystem
-from pandac.PandaModules import Filename
-from pandac.PandaModules import DSearchPath
-import xml.etree.ElementTree as ET
-import LandingPageHTML
-from StringIO import StringIO
-
-class LandingPage:
- notify = directNotify.newCategory("LandingPage")
- def __init__(self):
- self.headerTemplate = LandingPageHTML.header
- self.footerTemplate = LandingPageHTML.footer
-
- self.menu = {}
-
- self.uriToTitle = {}
-
- self.quickStats = [[],{}]
-
- self.addQuickStat("Pages Served", 0, 0)
-
- self.favicon = self.readFavIcon()
-
-
- def readFavIcon(self):
- vfs = VirtualFileSystem.getGlobalPtr()
- filename = Filename('favicon.ico')
-
- searchPath = DSearchPath()
- searchPath.appendDirectory(Filename('.'))
- searchPath.appendDirectory(Filename('etc'))
- searchPath.appendDirectory(Filename.fromOsSpecific(os.path.expandvars('$DIRECT/src/http')))
- searchPath.appendDirectory(Filename.fromOsSpecific(os.path.expandvars('direct/src/http')))
- searchPath.appendDirectory(Filename.fromOsSpecific(os.path.expandvars('direct/http')))
- found = vfs.resolveFilename(filename,searchPath)
- if not found:
- raise "Couldn't find direct/http/favicon.ico"
-
- return vfs.readFile(filename, 1)
-
-
- def addTab(self, title, uri):
- self.menu[title] = uri
- self.uriToTitle[uri] = title
-
- def getMenu(self, activeTab):
- return LandingPageHTML.getTabs(self.menu,activeTab)
-
- def getMenuTags(self, activeTab):
- return LandingPageHTML.getTabTags(self.menu, activeTab)
-
- def getHeader(self, activeTab = "Main", headTag=None, bodyTag=None):
- if headTag is None:
- headTag = ET.Element('head')
- if bodyTag is None:
- bodyTag = ET.Element('body')
-
- # make sure each component has elements to make formatting consistent
- headTag.append(ET.Comment(''))
- bodyTag.append(ET.Comment(''))
-
- fileStr = StringIO()
- ET.ElementTree(headTag).write(fileStr, encoding='utf-8')
- headTagStr = unicodeUtf8(fileStr.getvalue())
- # remove the tag closer
- #
- headTagStr = headTagStr[:headTagStr.rindex('<')]
-
- # fill in the prefab body tag content
- titleStr = LandingPageHTML.title
- landing = ET.Element('body')
- LandingPageHTML.addBodyHeaderAndContent(landing, titleStr, self.getMenuTags(activeTab))
-
- fileStr = StringIO()
- ET.ElementTree(landing).write(fileStr, encoding='utf-8')
- landingStr = unicodeUtf8(fileStr.getvalue())
- # remove
- landingStr = landingStr[landingStr.index('>')+1:]
- # remove tag closers
- for i in xrange(3):
- #
- # contents
- #
- landingStr = landingStr[:landingStr.rindex('<')]
-
- fileStr = StringIO()
- ET.ElementTree(bodyTag).write(fileStr, encoding='utf-8')
- bodyTagStr = unicodeUtf8(fileStr.getvalue())
- # extract
- bodyStr = bodyTagStr[bodyTagStr.index('>')+1:]
- bodyTagStr = bodyTagStr[:bodyTagStr.index('>')+1]
-
- bodyStr = bodyTagStr + '\n' + landingStr + '\n' + bodyStr
-
- s = self.headerTemplate % {'titlestring': titleStr,
- 'headTag' : headTagStr,
- 'bodyTag': bodyStr,
- }
- return s
-
- def getFooter(self):
- return self.footerTemplate % {'contact' : LandingPageHTML.contactInfo}
-
- def getServicesPage(self, uriToHandler):
- output = ""
-
- uriList = uriToHandler.keys()
-
- uriList.sort()
-
- autoList = []
-
- if "/" in uriList:
- uriList.remove("/")
- autoList.append("/")
- if "/services" in uriList:
- uriList.remove("/services")
- autoList.append("/services")
- if "/default.css" in uriList:
- uriList.remove("/default.css")
- autoList.append("/default.css")
- if "/favicon.ico" in uriList:
- uriList.remove("/favicon.ico")
- autoList.append("/favicon.ico")
-
- output += LandingPageHTML.getURITable(title="Application",uriList=uriList,uriToHandler=uriToHandler)
-
- output += LandingPageHTML.getURITable(title="Admin",uriList=autoList,uriToHandler=uriToHandler)
-
- return output
-
- def populateMainPage(self, body):
- LandingPageHTML.mainPageBody = body
-
- def setTitle(self, title):
- if LandingPageHTML.title == LandingPageHTML.defaultTitle:
- LandingPageHTML.title = title
- else:
- LandingPageHTML.title = LandingPageHTML.title + " + " + title
-
- def setDescription(self,desc):
- if LandingPageHTML.description == LandingPageHTML.defaultDesc:
- LandingPageHTML.description = desc
- else:
- LandingPageHTML.description = LandingPageHTML.description + "
\n" + desc
-
- def setContactInfo(self,info):
- LandingPageHTML.contactInfo = info
-
- def getDescription(self):
- return LandingPageHTML.description
-
- def getQuickStatsTable(self):
- return LandingPageHTML.getQuickStatsTable(self.quickStats)
-
- def getMainPage(self):
- return LandingPageHTML.mainPageBody % {"description" : self.getDescription(),
- "quickstats" : self.getQuickStatsTable()}
-
- def getStyleSheet(self):
- return LandingPageHTML.stylesheet
-
- def getFavIcon(self):
- return self.favicon
-
- def skin(self, body, uri, headTag=None, bodyTag=None):
- title = self.uriToTitle.get(uri,"Services")
- return self.getHeader(title, headTag, bodyTag) + body + self.getFooter()
-
- def addQuickStat(self,item,value,position):
- if item in self.quickStats[1]:
- assert self.notify.warning("Ignoring duplicate addition of quickstat %s." % item)
- return
-
- self.quickStats[0].insert(position,item)
- self.quickStats[1][item] = value
-
- def updateQuickStat(self,item,value):
- assert item in self.quickStats[1]
-
- self.quickStats[1][item] = value
-
- def incrementQuickStat(self,item):
- assert item in self.quickStats[1]
-
- self.quickStats[1][item] += 1
diff --git a/direct/src/http/LandingPageHTML.py b/direct/src/http/LandingPageHTML.py
deleted file mode 100755
index bc04caf80e..0000000000
--- a/direct/src/http/LandingPageHTML.py
+++ /dev/null
@@ -1,476 +0,0 @@
-# -- Text content for the landing page. You should change these for yours! --
-
-import xml.etree.ElementTree as ET
-
-title = "Landing Page"
-defaultTitle = title
-
-description = "To set this description, call WebRequestDispatcher.setDescription! You can also add stats to the table below by calling WebRequestDispatcher.addQuickStat(Name,Value,PositionInTable)."
-defaultDesc = description
-
-contactInfo = "M. Ian Graham - ian.graham@dig.com"
-
-
-# -- Begin fancy layout stuff, change at your own risk --
-
-stylesheet = '''
- body
- {
- margin: 0;
- padding: 0;
- font-size: 90%;
- font-family: Verdana, sans-serif;
- background-color: #fff;
- color: #333;
- }
-
- p
- {
- margin: 0;
- padding: 10px;
- background-color: #eee;
- }
-
- h2
- {
- font-size: 140%;
- color: #666;
- background-color: #fff;
- width: 22em;
- margin-left: 150px;
- margin-top: 0px;
- }
-
- h3
- {
- padding-top: 10px;
- margin-top: 0px;
- margin-left: 20px;
- }
-
- pre
- {
- margin-left: 20px;
- margin-bottom: 0px;
- padding-bottom: 10px;
- }
-
- a
- {
- text-decoration: none;
- color: #333;
- }
-
- a:hover
- {
- text-decoration: underline;
- }
-
- #header
- {
- margin: 0;
- padding: 0;
- background-color: #fff;
- }
-
- #footer
- {
- margin: 0;
- padding: 3px;
- text-align: right;
- background-color: #fff;
- border-top: 1px solid #778;
- font: 10px Verdana, sans-serif;
- }
-
- #contents
- {
- margin: 0;
- padding: 25;
- background-color: #eee;
- min-height:600px;
- height:auto !important;
- height:600px;
- }
-
-
-
- #navcontainer
- {
- margin:0;
- padding: 0;
- }
-
- #navlist
- {
- padding: 3px 0;
- margin-left: 0;
- margin: 0;
- border-bottom: 1px solid #778;
- font: bold 12px Verdana, sans-serif;
- background-color: transparent;
- }
-
- #navlist li
- {
- list-style: none;
- margin: 0;
- display: inline;
- }
-
- #navlist li a
- {
- padding: 3px 0.5em;
- margin-left: 3px;
- border: 1px solid #778;
- border-bottom: none;
- background: #DDE;
- text-decoration: none;
- }
-
- #navlist li a:link { color: #448; }
- #navlist li a:visited { color: #667; }
-
- #navlist li a:hover
- {
- color: #000;
- background: #AAE;
- border-color: #227;
- }
-
- #navlist li a#current
- {
- background: #eee;
- border-bottom: 1px solid #eee;
- }
-
- #navlist li.first
- {
- margin-left: 150px;
- }
-
-
-
- table
- {
- border-spacing:1px;
- background:#E7E7E7;
- color:#333;
- }
-
- caption
- {
- border: #666666;
- border-bottom: 2px solid #666666;
- margin-left: 2px;
- margin-right: 2px;
- padding: 10px;
- background: #cfcfdf;
- font: 15px 'Verdana', Arial, Helvetica, sans-serif;
- font-weight: bold;
- }
-
- td, th
- {
- font:13px 'Courier New',monospace;
- padding: 4px;
- }
-
- thead th
- {
- text-align: center;
- background: #dde;
- color: #666666;
- border: 1px solid #ffffff;
- text-transform: uppercase;
- }
-
- tbody th
- {
- font-weight: bold;
- }
-
- tbody tr
- {
- background: #efeffc;
- text-align: left;
- }
-
- tbody tr.odd
- {
- background: #ffffff;
- border-top: 1px solid #ffffff;
- }
-
- tbody th a:hover
- {
- color: #009900;
- }
-
- tbody tr td
- {
- text-align: left
- height: 30px;
- background: #ffffff;
- border: 1px solid #ffffff;
- color: #333;
- }
-
- tbody tr.odd td
- {
- background: #efeffc;
- border-top: 1px solid #ffffff;
- }
-
- tbody tr[altColoring="1"] td
- {
- background: LightCyan;
- border-top: 1px solid #ffffff;
- }
-
- tbody tr[altColoring="1"].odd td
- {
- background: PaleTurquoise;
- border-top: 1px solid #ffffff;
- }
-
- tbody tr[altColoring="2"] td
- {
- background: LightSalmon;
- border-top: 1px solid #ffffff;
- }
-
- tbody tr[altColoring="2"].odd td
- {
- background: SandyBrown;
- border-top: 1px solid #ffffff;
- }
-
- tbody tr.dead td
- {
- background:#ff0000;
- border-top: 1px solid #ffffff;
- }
-
- table td a:link, table td a:visited
- {
- display: block;
- padding: 0px;
- margin: 0px;
- width: 100%;
- text-decoration: none;
- color: #333;
- }
-
- html>body #navcontainer li a { width: auto; }
-
- table td a:hover
- {
- color: #000000;
- background: #aae;
- }
-
- tfoot th, tfoot td
- {
- background: #dfdfdf;
- padding: 3px;
- text-align: center;
- font: 14px 'Verdana', Arial, Helvetica, sans-serif;
- font-weight: bold;
- border-bottom: 1px solid #cccccc;
- border-top: 1px solid #DFDFDF;
- }
-\r\n'''
-
-header = '''
-
-
-%(headTag)s
-
-
%(titlestring)s
-
-
-
-%(bodyTag)s
-'''
-
-# this portion of the body is now added dynamically in order to support changes to the body tag
-# attributes
-'''
-
-
-
-
-
-
-
-
-
-'''
-
-# caller must remove ' ' from end of output string derived from what is returned
-def addBodyHeaderAndContent(bodyTag, titleString, menuTags):
- SE = ET.SubElement
- bodyTag.append(ET.Comment('HEADER'))
- header = SE(bodyTag, 'div', id='header')
- h2 = SE(header, 'h2')
- h2.text = titleString
- navContainer = SE(header, 'div', id='navcontainer')
- navList = SE(navContainer, 'ul', id='navlist')
- for menuTag in menuTags:
- navList.append(menuTag)
- bodyTag.append(ET.Comment('CONTENT'))
- contents = SE(bodyTag, 'div', id='contents')
- center = SE(contents, 'center')
- # for ease of removal of center tag closer
- center.append(ET.Comment(''))
-
-mainPageBody = '''
-%(description)s
-
-%(quickstats)s
-'''
-
-footer = '''
-
-
-
-
-
-
-
-