Skip to content
Browse files

Added the needed dependencies.

  • Loading branch information...
1 parent ac69a73 commit fe7edfde43bf6ff30124960962fa3ae87e3297be @fidlej committed Jan 27, 2013
Showing with 9,436 additions and 0 deletions.
  1. +10 −0 README.md
  2. 0 collected/data/.gitignore
  3. +1 −0 collected/data/known_geo.dat
  4. +1 −0 collected/data/real_dates.dat
  5. +1 −0 collected/data/report.dat
  6. BIN collected/data/warm.png
  7. 0 collected/exports/.gitignore
  8. +1 −0 collected/exports/avgs.txt
  9. +1 −0 collected/exports/day_avgs.txt
  10. +1 −0 collected/locks/.gitignore
  11. 0 collected/storage/.gitignore
  12. +6 −0 python-thirdparty/flup/.hgignore
  13. +230 −0 python-thirdparty/flup/ChangeLog
  14. +18 −0 python-thirdparty/flup/PKG-INFO
  15. +231 −0 python-thirdparty/flup/ez_setup.py
  16. +18 −0 python-thirdparty/flup/flup.egg-info/PKG-INFO
  17. +29 −0 python-thirdparty/flup/flup.egg-info/SOURCES.txt
  18. +1 −0 python-thirdparty/flup/flup.egg-info/dependency_links.txt
  19. +12 −0 python-thirdparty/flup/flup.egg-info/entry_points.txt
  20. +1 −0 python-thirdparty/flup/flup.egg-info/top_level.txt
  21. +1 −0 python-thirdparty/flup/flup.egg-info/zip-safe
  22. +1 −0 python-thirdparty/flup/flup/__init__.py
  23. +1 −0 python-thirdparty/flup/flup/client/__init__.py
  24. +461 −0 python-thirdparty/flup/flup/client/fcgi_app.py
  25. +176 −0 python-thirdparty/flup/flup/client/scgi_app.py
  26. +1 −0 python-thirdparty/flup/flup/server/__init__.py
  27. +201 −0 python-thirdparty/flup/flup/server/ajp.py
  28. +949 −0 python-thirdparty/flup/flup/server/ajp_base.py
  29. +199 −0 python-thirdparty/flup/flup/server/ajp_fork.py
  30. +71 −0 python-thirdparty/flup/flup/server/cgi.py
  31. +152 −0 python-thirdparty/flup/flup/server/fcgi.py
  32. +1,175 −0 python-thirdparty/flup/flup/server/fcgi_base.py
  33. +170 −0 python-thirdparty/flup/flup/server/fcgi_fork.py
  34. +12 −0 python-thirdparty/flup/flup/server/paste_factory.py
  35. +414 −0 python-thirdparty/flup/flup/server/preforkserver.py
  36. +194 −0 python-thirdparty/flup/flup/server/scgi.py
  37. +534 −0 python-thirdparty/flup/flup/server/scgi_base.py
  38. +192 −0 python-thirdparty/flup/flup/server/scgi_fork.py
  39. +175 −0 python-thirdparty/flup/flup/server/threadedserver.py
  40. +121 −0 python-thirdparty/flup/flup/server/threadpool.py
  41. +5 −0 python-thirdparty/flup/setup.cfg
  42. +40 −0 python-thirdparty/flup/setup.py
  43. +46 −0 python-thirdparty/pytz-2008b/CHANGES.txt
  44. +19 −0 python-thirdparty/pytz-2008b/LICENSE.txt
  45. +5 −0 python-thirdparty/pytz-2008b/MANIFEST.in
  46. +52 −0 python-thirdparty/pytz-2008b/PKG-INFO
  47. +326 −0 python-thirdparty/pytz-2008b/README.txt
  48. +52 −0 python-thirdparty/pytz-2008b/pytz.egg-info/PKG-INFO
  49. +583 −0 python-thirdparty/pytz-2008b/pytz.egg-info/SOURCES.txt
  50. +1 −0 python-thirdparty/pytz-2008b/pytz.egg-info/dependency_links.txt
  51. +1 −0 python-thirdparty/pytz-2008b/pytz.egg-info/top_level.txt
  52. +1 −0 python-thirdparty/pytz-2008b/pytz.egg-info/zip-safe
  53. +1,405 −0 python-thirdparty/pytz-2008b/pytz/__init__.py
  54. +127 −0 python-thirdparty/pytz-2008b/pytz/reference.py
  55. +35 −0 python-thirdparty/pytz-2008b/pytz/tests/test_docs.py
  56. +481 −0 python-thirdparty/pytz-2008b/pytz/tests/test_tzinfo.py
  57. +113 −0 python-thirdparty/pytz-2008b/pytz/tzfile.py
  58. +382 −0 python-thirdparty/pytz-2008b/pytz/tzinfo.py
  59. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Abidjan
  60. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Accra
  61. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Addis_Ababa
  62. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Algiers
  63. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Asmara
  64. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Asmera
  65. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Bamako
  66. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Bangui
  67. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Banjul
  68. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Bissau
  69. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Blantyre
  70. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Brazzaville
  71. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Bujumbura
  72. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Cairo
  73. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Casablanca
  74. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Ceuta
  75. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Conakry
  76. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Dakar
  77. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Dar_es_Salaam
  78. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Djibouti
  79. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Douala
  80. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/El_Aaiun
  81. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Freetown
  82. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Gaborone
  83. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Harare
  84. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Johannesburg
  85. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Kampala
  86. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Khartoum
  87. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Kigali
  88. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Kinshasa
  89. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Lagos
  90. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Libreville
  91. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Lome
  92. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Luanda
  93. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Lubumbashi
  94. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Lusaka
  95. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Malabo
  96. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Maputo
  97. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Maseru
  98. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Mbabane
  99. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Mogadishu
  100. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Monrovia
  101. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Nairobi
  102. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Ndjamena
  103. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Niamey
  104. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Nouakchott
  105. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Ouagadougou
  106. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Porto-Novo
  107. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Sao_Tome
  108. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Timbuktu
  109. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Tripoli
  110. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Tunis
  111. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Africa/Windhoek
  112. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Adak
  113. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Anchorage
  114. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Anguilla
  115. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Antigua
  116. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Araguaina
  117. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Argentina/Buenos_Aires
  118. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Argentina/Catamarca
  119. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Argentina/ComodRivadavia
  120. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Argentina/Cordoba
  121. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Argentina/Jujuy
  122. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Argentina/La_Rioja
  123. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Argentina/Mendoza
  124. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Argentina/Rio_Gallegos
  125. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Argentina/San_Juan
  126. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Argentina/San_Luis
  127. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Argentina/Tucuman
  128. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Argentina/Ushuaia
  129. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Aruba
  130. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Asuncion
  131. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Atikokan
  132. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Atka
  133. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Bahia
  134. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Barbados
  135. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Belem
  136. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Belize
  137. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Blanc-Sablon
  138. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Boa_Vista
  139. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Bogota
  140. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Boise
  141. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Buenos_Aires
  142. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Cambridge_Bay
  143. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Campo_Grande
  144. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Cancun
  145. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Caracas
  146. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Catamarca
  147. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Cayenne
  148. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Cayman
  149. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Chicago
  150. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Chihuahua
  151. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Coral_Harbour
  152. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Cordoba
  153. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Costa_Rica
  154. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Cuiaba
  155. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Curacao
  156. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Danmarkshavn
  157. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Dawson
  158. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Dawson_Creek
  159. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Denver
  160. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Detroit
  161. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Dominica
  162. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Edmonton
  163. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Eirunepe
  164. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/El_Salvador
  165. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Ensenada
  166. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Fort_Wayne
  167. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Fortaleza
  168. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Glace_Bay
  169. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Godthab
  170. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Goose_Bay
  171. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Grand_Turk
  172. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Grenada
  173. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Guadeloupe
  174. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Guatemala
  175. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Guayaquil
  176. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Guyana
  177. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Halifax
  178. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Havana
  179. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Hermosillo
  180. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Indiana/Indianapolis
  181. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Indiana/Knox
  182. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Indiana/Marengo
  183. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Indiana/Petersburg
  184. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Indiana/Tell_City
  185. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Indiana/Vevay
  186. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Indiana/Vincennes
  187. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Indiana/Winamac
  188. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Indianapolis
  189. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Inuvik
  190. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Iqaluit
  191. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Jamaica
  192. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Jujuy
  193. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Juneau
  194. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Kentucky/Louisville
  195. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Kentucky/Monticello
  196. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Knox_IN
  197. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/La_Paz
  198. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Lima
  199. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Los_Angeles
  200. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Louisville
  201. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Maceio
  202. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Managua
  203. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Manaus
  204. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Marigot
  205. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Martinique
  206. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Mazatlan
  207. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Mendoza
  208. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Menominee
  209. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Merida
  210. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Mexico_City
  211. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Miquelon
  212. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Moncton
  213. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Monterrey
  214. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Montevideo
  215. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Montreal
  216. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Montserrat
  217. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Nassau
  218. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/New_York
  219. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Nipigon
  220. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Nome
  221. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Noronha
  222. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/North_Dakota/Center
  223. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/North_Dakota/New_Salem
  224. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Panama
  225. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Pangnirtung
  226. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Paramaribo
  227. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Phoenix
  228. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Port-au-Prince
  229. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Port_of_Spain
  230. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Porto_Acre
  231. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Porto_Velho
  232. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Puerto_Rico
  233. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Rainy_River
  234. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Rankin_Inlet
  235. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Recife
  236. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Regina
  237. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Resolute
  238. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Rio_Branco
  239. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Rosario
  240. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Santiago
  241. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Santo_Domingo
  242. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Sao_Paulo
  243. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Scoresbysund
  244. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Shiprock
  245. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/St_Barthelemy
  246. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/St_Johns
  247. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/St_Kitts
  248. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/St_Lucia
  249. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/St_Thomas
  250. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/St_Vincent
  251. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Swift_Current
  252. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Tegucigalpa
  253. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Thule
  254. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Thunder_Bay
  255. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Tijuana
  256. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Toronto
  257. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Tortola
  258. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Vancouver
  259. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Virgin
  260. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Whitehorse
  261. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Winnipeg
  262. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Yakutat
  263. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/America/Yellowknife
  264. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Antarctica/Casey
  265. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Antarctica/Davis
  266. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Antarctica/DumontDUrville
  267. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Antarctica/Mawson
  268. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Antarctica/McMurdo
  269. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Antarctica/Palmer
  270. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Antarctica/Rothera
  271. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Antarctica/South_Pole
  272. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Antarctica/Syowa
  273. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Antarctica/Vostok
  274. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Arctic/Longyearbyen
  275. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Asia/Aden
  276. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Asia/Almaty
  277. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Asia/Amman
  278. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Asia/Anadyr
  279. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Asia/Aqtau
  280. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Asia/Aqtobe
  281. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Asia/Ashgabat
  282. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Asia/Ashkhabad
  283. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Asia/Baghdad
  284. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Asia/Bahrain
  285. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Asia/Baku
  286. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Asia/Bangkok
  287. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Asia/Beirut
  288. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Asia/Bishkek
  289. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Asia/Brunei
  290. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Asia/Calcutta
  291. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Asia/Choibalsan
  292. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Asia/Chongqing
  293. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Asia/Chungking
  294. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Asia/Colombo
  295. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Asia/Dacca
  296. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Asia/Damascus
  297. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Asia/Dhaka
  298. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Asia/Dili
  299. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Asia/Dubai
  300. BIN python-thirdparty/pytz-2008b/pytz/zoneinfo/Asia/Dushanbe
Sorry, we could not display the entire diff because too many files (706) changed.
View
10 README.md
@@ -0,0 +1,10 @@
+
+Usage
+=====
+
+ cd site
+ DEBUG=1 ./dailyCleanup.sh
+
+ cd frontend
+ ./run.sh
+ firefox http://0.0.0.0:1234/
View
0 collected/data/.gitignore
No changes.
View
1 collected/data/known_geo.dat
@@ -0,0 +1 @@
+�}q.
View
1 collected/data/real_dates.dat
@@ -0,0 +1 @@
+�}q.
View
1 collected/data/report.dat
@@ -0,0 +1 @@
+�]q.
View
BIN collected/data/warm.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 collected/exports/.gitignore
No changes.
View
1 collected/exports/avgs.txt
@@ -0,0 +1 @@
+
View
1 collected/exports/day_avgs.txt
@@ -0,0 +1 @@
+
View
1 collected/locks/.gitignore
@@ -0,0 +1 @@
+/*.pid
View
0 collected/storage/.gitignore
No changes.
View
6 python-thirdparty/flup/.hgignore
@@ -0,0 +1,6 @@
+syntax: glob
+*~
+*.pyc
+build
+dist
+flup.egg-info
View
230 python-thirdparty/flup/ChangeLog
@@ -0,0 +1,230 @@
+2007-09-10 Allan Saddi <allan@saddi.com>
+
+ * Fix readline implementations so size argument is checked
+ earlier.
+
+2007-07-14 Allan Saddi <allan@saddi.com>
+
+ * Prevent ThreadPool inconsistences if an exception is
+ actually raised. Thanks to Tim Chen for the patch.
+
+2007-06-05 Allan Saddi <allan@saddi.com>
+
+ * Remove publisher and middleware packages.
+ * Add cgi server for completeness.
+
+2007-05-17 Allan Saddi <allan@saddi.com>
+
+ * Fix fcgi_fork so it can run on Solaris. Thanks to
+ Basil Crow for the patch.
+
+2007-01-22 Allan Saddi <allan@saddi.com>
+
+ * Fix eunuchs import issue.
+
+2007-01-10 Allan Saddi <allan@saddi.com>
+
+ * Support gzip compression of XHTML pages using the
+ correct MIME type.
+
+2006-12-29 Allan Saddi <allan@saddi.com>
+
+ * Deprecate WSGI_SCRIPT_NAME and scriptName in scgi_base.
+ Modern versions of mod_scgi correctly set SCRIPT_NAME &
+ PATH_INFO.
+
+2006-12-13 Allan Saddi <allan@saddi.com>
+
+ * Fix problem in session.py seen when optimization is on.
+
+2006-12-05 Allan Saddi <allan@saddi.com>
+
+ * Update servers to default to an empty QUERY_STRING if
+ not present in the environ.
+ * Update gzip.py: compresslevel -> compress_level
+ * Update gzip.py by updating docstrings and renaming
+ classes/methods/functions to better follow Python naming
+ conventions. NB: mimeTypes keyword parameter is now
+ mime_types.
+
+2006-12-02 Allan Saddi <allan@saddi.com>
+
+ * Change intra-package imports into absolute imports.
+
+2006-12-02 Allan Saddi <allan@saddi.com>
+
+ * Add forceCookieOutput attribute to SessionService to
+ force Set-Cookie output for the current request.
+
+2006-12-01 Allan Saddi <allan@saddi.com>
+
+ * Update setup script.
+
+2006-11-26 Allan Saddi <allan@saddi.com>
+
+ * Don't attempt to install signal handlers under Windows
+ to improve compatibility.
+
+2006-11-24 Allan Saddi <allan@saddi.com>
+
+ * Add *_thread egg entry-point aliases.
+ * Add UNIX domain socket support to scgi, scgi_fork,
+ scgi_app.
+ * Add flup.client package which contains various
+ WSGI -> connector client implentations. (So far: FastCGI,
+ and SCGI.)
+
+2006-11-19 Allan Saddi <allan@saddi.com>
+
+ * Change mime-type matching algorithm in GzipMiddleware.
+ Strip parameters (e.g. "encoding") and accept a list of
+ regexps. By default, compress 'text/.*' mime-types.
+
+2006-11-10 Allan Saddi <allan@saddi.com>
+
+ * Add cookieAttributes to SessionService to make it easier
+ to customize the generated cookie's attributes.
+
+2006-08-28 Allan Saddi <allan@saddi.com>
+
+ * Add support for FastCGI roles other than FCGI_RESPONDER.
+ Patch provided by Seairth Jacobs.
+
+2006-08-02 Allan Saddi <allan@saddi.com>
+
+ * Add cookieExpiration keyword to SessionService /
+ SessionMiddleware to adjust the session cookie's expiration.
+ Thanks to Blaise Laflamme for the suggestion.
+
+2006-06-27 Allan Saddi <allan@saddi.com>
+
+ * Set close-on-exec flag on all server sockets. Thanks to
+ Ralf Schmitt for reporting the problem.
+
+2006-06-18 Allan Saddi <allan@saddi.com>
+
+ * Stop ignoring EPIPE exceptions, as this is probably the
+ wrong thing to do. (Application is unaware of disconnected
+ clients and the CPU spins when sending large files to a
+ disconnected client.) Thanks to Ivan Sagalaev for bringing
+ this to my attention.
+
+ NB: Existing applications that use the flup servers may begin
+ seeing socket.error exceptions...
+
+2006-05-18 Allan Saddi <allan@saddi.com>
+
+ * Added umask keyword parameter to fcgi and fcgi_fork,
+ for use when binding to a UNIX socket.
+
+2006-05-03 Allan Saddi <allan@saddi.com>
+
+ * Fix illusive problem with AJP implementation. Thanks to
+ Moshe Van der Sterre for explaining the problem and
+ providing a fix.
+
+2006-04-06 Allan Saddi <allan@saddi.com>
+
+ * Catch a strange FieldStorage case. Seen in production.
+ Not quite sure what causes it.
+
+2006-03-21 Allan Saddi <allan@saddi.com>
+
+ * Add maxRequests option to PreforkServer. Patch provided by
+ Wojtek Sobczuk.
+
+2006-02-23 Allan Saddi <allan@saddi.com>
+
+ * Add paste.server_factory-compliant factories and respective
+ egg entry points. Thanks to Luis Bruno for the code.
+
+ Add debug option to servers, which is True by default.
+ Currently, only server-level error handling is affected.
+
+2006-01-15 Allan Saddi <allan@saddi.com>
+
+ * Change the behavior of ImportingModuleResolver when dealing
+ with ImportErrors. Previously, it would act as if the module
+ did not exist. Now, it propagates the exception to another
+ level (outer middleware or WSGI). Reported by Scot Doyle.
+
+2006-01-05 Allan Saddi <allan@saddi.com>
+
+ * Improve Windows compatibility by conditionally installing
+ SIGHUP handler. Thanks to Brad Miller for pointing out the
+ problem and providing a fix.
+
+2005-12-19 Allan Saddi <allan@saddi.com>
+
+ * Fix socket leak in eunuchs socketpair() wrapper. Thanks to
+ Georg Bauer for pointing this out.
+
+2005-12-16 Allan Saddi <allan@saddi.com>
+
+ * Switch to setuptools for egg support.
+ * Add higher-level 404 error page support. Thanks to Scot Doyle
+ for suggesting the idea and providing code. If you previously
+ subclassed Publisher to provide a custom 404 error page, this
+ is now broken. It will have to be massaged to fit the new
+ calling convention.
+
+2005-11-28 Allan Saddi <allan@saddi.com>
+
+ * Fix issue with FCGI_GET_VALUES handling. Thanks to
+ Timothy Wright for pointing this out.
+
+2005-11-18 Allan Saddi <allan@saddi.com>
+
+ * When running under Python < 2.4, attempt to use socketpair()
+ from eunuchs module.
+
+2005-09-07 Allan Saddi <allan@saddi.com>
+
+ * Python 2.3 doesn't define socket.SHUT_WR, which affected
+ the closing of the FastCGI socket with the server. This would
+ cause output to hang. Thanks to Eugene Lazutkin for bringing
+ the problem to my attention and going out of his way to help
+ me debug it!
+
+2005-07-03 Allan Saddi <allan@saddi.com>
+
+ * Ensure session identifiers only contain ASCII characters when
+ using a non-ASCII locale. Thanks to Ksenia Marasanova for the
+ the fix.
+
+2005-06-12 Allan Saddi <allan@saddi.com>
+
+ * Cleanly close connection socket to avoid sending a TCP RST to
+ the web server. (fcgi_base) Fix suggested by Dima Barsky.
+
+2005-05-31 Allan Saddi <allan@saddi.com>
+
+ * Take scriptName from the WSGI_SCRIPT_NAME environment variable
+ passed from the web server, if present.
+ * Check if scriptName is None, and if so, don't modify SCRIPT_NAME
+ & PATH_INFO. For better compatibility with cgi2scgi. (scgi_base)
+
+2005-05-18 Allan Saddi <allan@saddi.com>
+
+ * Change default allowedServers for ajp and scgi to ['127.0.0.1'].
+ * Accept PATH_INFO from environment for scgi servers, in case
+ cgi2scgi is being used. Submitted by Ian Bicking.
+ * Change threaded servers so wsgi.multiprocess is False by default.
+ Allow it to be changed by keyword argument.
+ * Fix wsgi.multiprocess for scgi_fork. (Set to True.)
+
+2005-05-15 Allan Saddi <allan@saddi.com>
+
+ * Prevent possible deadlock related to DiskSessionStore locking.
+ * Add logic to SessionStore so that it will block if attempting to
+ check out a Session that's already been checked out.
+
+2005-05-14 Allan Saddi <allan@saddi.com>
+
+ * Convert the use of decorators in session.py to something
+ compatible with Python <2.4.
+
+2005-04-23 Allan Saddi <allan@saddi.com>
+
+ * Ensure that SessionStore.checkOutSession() never returns an
+ invalidated Session. Reported by Rene Dudfield.
View
18 python-thirdparty/flup/PKG-INFO
@@ -0,0 +1,18 @@
+Metadata-Version: 1.0
+Name: flup
+Version: 1.0
+Summary: Random assortment of WSGI servers
+Home-page: http://www.saddi.com/software/flup/
+Author: Allan Saddi
+Author-email: allan@saddi.com
+License: BSD
+Description: UNKNOWN
+Platform: UNKNOWN
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: Environment :: Web Environment
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: BSD License
+Classifier: Operating System :: OS Independent
+Classifier: Programming Language :: Python
+Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Server
+Classifier: Topic :: Software Development :: Libraries :: Python Modules
View
231 python-thirdparty/flup/ez_setup.py
@@ -0,0 +1,231 @@
+#!python
+"""Bootstrap setuptools installation
+
+If you want to use setuptools in your package's setup.py, just include this
+file in the same directory with it, and add this to the top of your setup.py::
+
+ from ez_setup import use_setuptools
+ use_setuptools()
+
+If you want to require a specific version of setuptools, set a download
+mirror, or use an alternate download directory, you can do so by supplying
+the appropriate options to ``use_setuptools()``.
+
+This file can also be run as a script to install or upgrade setuptools.
+"""
+import sys
+DEFAULT_VERSION = "0.6c6"
+DEFAULT_URL = "http://cheeseshop.python.org/packages/%s/s/setuptools/" % sys.version[:3]
+
+md5_data = {
+ 'setuptools-0.6b1-py2.3.egg': '8822caf901250d848b996b7f25c6e6ca',
+ 'setuptools-0.6b1-py2.4.egg': 'b79a8a403e4502fbb85ee3f1941735cb',
+ 'setuptools-0.6b2-py2.3.egg': '5657759d8a6d8fc44070a9d07272d99b',
+ 'setuptools-0.6b2-py2.4.egg': '4996a8d169d2be661fa32a6e52e4f82a',
+ 'setuptools-0.6b3-py2.3.egg': 'bb31c0fc7399a63579975cad9f5a0618',
+ 'setuptools-0.6b3-py2.4.egg': '38a8c6b3d6ecd22247f179f7da669fac',
+ 'setuptools-0.6b4-py2.3.egg': '62045a24ed4e1ebc77fe039aa4e6f7e5',
+ 'setuptools-0.6b4-py2.4.egg': '4cb2a185d228dacffb2d17f103b3b1c4',
+ 'setuptools-0.6c1-py2.3.egg': 'b3f2b5539d65cb7f74ad79127f1a908c',
+ 'setuptools-0.6c1-py2.4.egg': 'b45adeda0667d2d2ffe14009364f2a4b',
+ 'setuptools-0.6c2-py2.3.egg': 'f0064bf6aa2b7d0f3ba0b43f20817c27',
+ 'setuptools-0.6c2-py2.4.egg': '616192eec35f47e8ea16cd6a122b7277',
+ 'setuptools-0.6c3-py2.3.egg': 'f181fa125dfe85a259c9cd6f1d7b78fa',
+ 'setuptools-0.6c3-py2.4.egg': 'e0ed74682c998bfb73bf803a50e7b71e',
+ 'setuptools-0.6c3-py2.5.egg': 'abef16fdd61955514841c7c6bd98965e',
+ 'setuptools-0.6c4-py2.3.egg': 'b0b9131acab32022bfac7f44c5d7971f',
+ 'setuptools-0.6c4-py2.4.egg': '2a1f9656d4fbf3c97bf946c0a124e6e2',
+ 'setuptools-0.6c4-py2.5.egg': '8f5a052e32cdb9c72bcf4b5526f28afc',
+ 'setuptools-0.6c5-py2.3.egg': 'ee9fd80965da04f2f3e6b3576e9d8167',
+ 'setuptools-0.6c5-py2.4.egg': 'afe2adf1c01701ee841761f5bcd8aa64',
+ 'setuptools-0.6c5-py2.5.egg': 'a8d3f61494ccaa8714dfed37bccd3d5d',
+ 'setuptools-0.6c6-py2.3.egg': '35686b78116a668847237b69d549ec20',
+ 'setuptools-0.6c6-py2.4.egg': '3c56af57be3225019260a644430065ab',
+ 'setuptools-0.6c6-py2.5.egg': 'b2f8a7520709a5b34f80946de5f02f53',
+}
+
+import sys, os
+
+def _validate_md5(egg_name, data):
+ if egg_name in md5_data:
+ from md5 import md5
+ digest = md5(data).hexdigest()
+ if digest != md5_data[egg_name]:
+ print >>sys.stderr, (
+ "md5 validation of %s failed! (Possible download problem?)"
+ % egg_name
+ )
+ sys.exit(2)
+ return data
+
+
+def use_setuptools(
+ version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
+ download_delay=15
+):
+ """Automatically find/download setuptools and make it available on sys.path
+
+ `version` should be a valid setuptools version number that is available
+ as an egg for download under the `download_base` URL (which should end with
+ a '/'). `to_dir` is the directory where setuptools will be downloaded, if
+ it is not already available. If `download_delay` is specified, it should
+ be the number of seconds that will be paused before initiating a download,
+ should one be required. If an older version of setuptools is installed,
+ this routine will print a message to ``sys.stderr`` and raise SystemExit in
+ an attempt to abort the calling script.
+ """
+ try:
+ import setuptools
+ if setuptools.__version__ == '0.0.1':
+ print >>sys.stderr, (
+ "You have an obsolete version of setuptools installed. Please\n"
+ "remove it from your system entirely before rerunning this script."
+ )
+ sys.exit(2)
+ except ImportError:
+ egg = download_setuptools(version, download_base, to_dir, download_delay)
+ sys.path.insert(0, egg)
+ import setuptools; setuptools.bootstrap_install_from = egg
+
+ import pkg_resources
+ try:
+ pkg_resources.require("setuptools>="+version)
+
+ except pkg_resources.VersionConflict, e:
+ # XXX could we install in a subprocess here?
+ print >>sys.stderr, (
+ "The required version of setuptools (>=%s) is not available, and\n"
+ "can't be installed while this script is running. Please install\n"
+ " a more recent version first.\n\n(Currently using %r)"
+ ) % (version, e.args[0])
+ sys.exit(2)
+
+def download_setuptools(
+ version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
+ delay = 15
+):
+ """Download setuptools from a specified location and return its filename
+
+ `version` should be a valid setuptools version number that is available
+ as an egg for download under the `download_base` URL (which should end
+ with a '/'). `to_dir` is the directory where the egg will be downloaded.
+ `delay` is the number of seconds to pause before an actual download attempt.
+ """
+ import urllib2, shutil
+ egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3])
+ url = download_base + egg_name
+ saveto = os.path.join(to_dir, egg_name)
+ src = dst = None
+ if not os.path.exists(saveto): # Avoid repeated downloads
+ try:
+ from distutils import log
+ if delay:
+ log.warn("""
+---------------------------------------------------------------------------
+This script requires setuptools version %s to run (even to display
+help). I will attempt to download it for you (from
+%s), but
+you may need to enable firewall access for this script first.
+I will start the download in %d seconds.
+
+(Note: if this machine does not have network access, please obtain the file
+
+ %s
+
+and place it in this directory before rerunning this script.)
+---------------------------------------------------------------------------""",
+ version, download_base, delay, url
+ ); from time import sleep; sleep(delay)
+ log.warn("Downloading %s", url)
+ src = urllib2.urlopen(url)
+ # Read/write all in one block, so we don't create a corrupt file
+ # if the download is interrupted.
+ data = _validate_md5(egg_name, src.read())
+ dst = open(saveto,"wb"); dst.write(data)
+ finally:
+ if src: src.close()
+ if dst: dst.close()
+ return os.path.realpath(saveto)
+
+def main(argv, version=DEFAULT_VERSION):
+ """Install or upgrade setuptools and EasyInstall"""
+
+ try:
+ import setuptools
+ except ImportError:
+ egg = None
+ try:
+ egg = download_setuptools(version, delay=0)
+ sys.path.insert(0,egg)
+ from setuptools.command.easy_install import main
+ return main(list(argv)+[egg]) # we're done here
+ finally:
+ if egg and os.path.exists(egg):
+ os.unlink(egg)
+ else:
+ if setuptools.__version__ == '0.0.1':
+ # tell the user to uninstall obsolete version
+ use_setuptools(version)
+
+ req = "setuptools>="+version
+ import pkg_resources
+ try:
+ pkg_resources.require(req)
+ except pkg_resources.VersionConflict:
+ try:
+ from setuptools.command.easy_install import main
+ except ImportError:
+ from easy_install import main
+ main(list(argv)+[download_setuptools(delay=0)])
+ sys.exit(0) # try to force an exit
+ else:
+ if argv:
+ from setuptools.command.easy_install import main
+ main(argv)
+ else:
+ print "Setuptools version",version,"or greater has been installed."
+ print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)'
+
+
+
+def update_md5(filenames):
+ """Update our built-in md5 registry"""
+
+ import re
+ from md5 import md5
+
+ for name in filenames:
+ base = os.path.basename(name)
+ f = open(name,'rb')
+ md5_data[base] = md5(f.read()).hexdigest()
+ f.close()
+
+ data = [" %r: %r,\n" % it for it in md5_data.items()]
+ data.sort()
+ repl = "".join(data)
+
+ import inspect
+ srcfile = inspect.getsourcefile(sys.modules[__name__])
+ f = open(srcfile, 'rb'); src = f.read(); f.close()
+
+ match = re.search("\nmd5_data = {\n([^}]+)}", src)
+ if not match:
+ print >>sys.stderr, "Internal error!"
+ sys.exit(2)
+
+ src = src[:match.start(1)] + repl + src[match.end(1):]
+ f = open(srcfile,'w')
+ f.write(src)
+ f.close()
+
+
+if __name__=='__main__':
+ if len(sys.argv)>2 and sys.argv[1]=='--md5update':
+ update_md5(sys.argv[2:])
+ else:
+ main(sys.argv[1:])
+
+
+
+
+
View
18 python-thirdparty/flup/flup.egg-info/PKG-INFO
@@ -0,0 +1,18 @@
+Metadata-Version: 1.0
+Name: flup
+Version: 1.0
+Summary: Random assortment of WSGI servers
+Home-page: http://www.saddi.com/software/flup/
+Author: Allan Saddi
+Author-email: allan@saddi.com
+License: BSD
+Description: UNKNOWN
+Platform: UNKNOWN
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: Environment :: Web Environment
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: BSD License
+Classifier: Operating System :: OS Independent
+Classifier: Programming Language :: Python
+Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Server
+Classifier: Topic :: Software Development :: Libraries :: Python Modules
View
29 python-thirdparty/flup/flup.egg-info/SOURCES.txt
@@ -0,0 +1,29 @@
+.hgignore
+ChangeLog
+ez_setup.py
+setup.py
+flup/__init__.py
+flup.egg-info/PKG-INFO
+flup.egg-info/SOURCES.txt
+flup.egg-info/dependency_links.txt
+flup.egg-info/entry_points.txt
+flup.egg-info/top_level.txt
+flup.egg-info/zip-safe
+flup/client/__init__.py
+flup/client/fcgi_app.py
+flup/client/scgi_app.py
+flup/server/__init__.py
+flup/server/ajp.py
+flup/server/ajp_base.py
+flup/server/ajp_fork.py
+flup/server/cgi.py
+flup/server/fcgi.py
+flup/server/fcgi_base.py
+flup/server/fcgi_fork.py
+flup/server/paste_factory.py
+flup/server/preforkserver.py
+flup/server/scgi.py
+flup/server/scgi_base.py
+flup/server/scgi_fork.py
+flup/server/threadedserver.py
+flup/server/threadpool.py
View
1 python-thirdparty/flup/flup.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
View
12 python-thirdparty/flup/flup.egg-info/entry_points.txt
@@ -0,0 +1,12 @@
+
+ [paste.server_factory]
+ ajp = flup.server.ajp:factory
+ fcgi = flup.server.fcgi:factory
+ scgi = flup.server.scgi:factory
+ ajp_thread = flup.server.ajp:factory
+ fcgi_thread = flup.server.fcgi:factory
+ scgi_thread = flup.server.scgi:factory
+ ajp_fork = flup.server.ajp_fork:factory
+ fcgi_fork = flup.server.fcgi_fork:factory
+ scgi_fork = flup.server.scgi_fork:factory
+
View
1 python-thirdparty/flup/flup.egg-info/top_level.txt
@@ -0,0 +1 @@
+flup
View
1 python-thirdparty/flup/flup.egg-info/zip-safe
@@ -0,0 +1 @@
+
View
1 python-thirdparty/flup/flup/__init__.py
@@ -0,0 +1 @@
+#
View
1 python-thirdparty/flup/flup/client/__init__.py
@@ -0,0 +1 @@
+#
View
461 python-thirdparty/flup/flup/client/fcgi_app.py
@@ -0,0 +1,461 @@
+# Copyright (c) 2006 Allan Saddi <allan@saddi.com>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $Id: fcgi_app.py 2109 2006-11-24 23:02:59Z asaddi $
+
+__author__ = 'Allan Saddi <allan@saddi.com>'
+__version__ = '$Revision: 2109 $'
+
+import select
+import struct
+import socket
+import errno
+
+__all__ = ['FCGIApp']
+
+# Constants from the spec.
+FCGI_LISTENSOCK_FILENO = 0
+
+FCGI_HEADER_LEN = 8
+
+FCGI_VERSION_1 = 1
+
+FCGI_BEGIN_REQUEST = 1
+FCGI_ABORT_REQUEST = 2
+FCGI_END_REQUEST = 3
+FCGI_PARAMS = 4
+FCGI_STDIN = 5
+FCGI_STDOUT = 6
+FCGI_STDERR = 7
+FCGI_DATA = 8
+FCGI_GET_VALUES = 9
+FCGI_GET_VALUES_RESULT = 10
+FCGI_UNKNOWN_TYPE = 11
+FCGI_MAXTYPE = FCGI_UNKNOWN_TYPE
+
+FCGI_NULL_REQUEST_ID = 0
+
+FCGI_KEEP_CONN = 1
+
+FCGI_RESPONDER = 1
+FCGI_AUTHORIZER = 2
+FCGI_FILTER = 3
+
+FCGI_REQUEST_COMPLETE = 0
+FCGI_CANT_MPX_CONN = 1
+FCGI_OVERLOADED = 2
+FCGI_UNKNOWN_ROLE = 3
+
+FCGI_MAX_CONNS = 'FCGI_MAX_CONNS'
+FCGI_MAX_REQS = 'FCGI_MAX_REQS'
+FCGI_MPXS_CONNS = 'FCGI_MPXS_CONNS'
+
+FCGI_Header = '!BBHHBx'
+FCGI_BeginRequestBody = '!HB5x'
+FCGI_EndRequestBody = '!LB3x'
+FCGI_UnknownTypeBody = '!B7x'
+
+FCGI_BeginRequestBody_LEN = struct.calcsize(FCGI_BeginRequestBody)
+FCGI_EndRequestBody_LEN = struct.calcsize(FCGI_EndRequestBody)
+FCGI_UnknownTypeBody_LEN = struct.calcsize(FCGI_UnknownTypeBody)
+
+if __debug__:
+ import time
+
+ # Set non-zero to write debug output to a file.
+ DEBUG = 0
+ DEBUGLOG = '/tmp/fcgi_app.log'
+
+ def _debug(level, msg):
+ if DEBUG < level:
+ return
+
+ try:
+ f = open(DEBUGLOG, 'a')
+ f.write('%sfcgi: %s\n' % (time.ctime()[4:-4], msg))
+ f.close()
+ except:
+ pass
+
+def decode_pair(s, pos=0):
+ """
+ Decodes a name/value pair.
+
+ The number of bytes decoded as well as the name/value pair
+ are returned.
+ """
+ nameLength = ord(s[pos])
+ if nameLength & 128:
+ nameLength = struct.unpack('!L', s[pos:pos+4])[0] & 0x7fffffff
+ pos += 4
+ else:
+ pos += 1
+
+ valueLength = ord(s[pos])
+ if valueLength & 128:
+ valueLength = struct.unpack('!L', s[pos:pos+4])[0] & 0x7fffffff
+ pos += 4
+ else:
+ pos += 1
+
+ name = s[pos:pos+nameLength]
+ pos += nameLength
+ value = s[pos:pos+valueLength]
+ pos += valueLength
+
+ return (pos, (name, value))
+
+def encode_pair(name, value):
+ """
+ Encodes a name/value pair.
+
+ The encoded string is returned.
+ """
+ nameLength = len(name)
+ if nameLength < 128:
+ s = chr(nameLength)
+ else:
+ s = struct.pack('!L', nameLength | 0x80000000L)
+
+ valueLength = len(value)
+ if valueLength < 128:
+ s += chr(valueLength)
+ else:
+ s += struct.pack('!L', valueLength | 0x80000000L)
+
+ return s + name + value
+
+class Record(object):
+ """
+ A FastCGI Record.
+
+ Used for encoding/decoding records.
+ """
+ def __init__(self, type=FCGI_UNKNOWN_TYPE, requestId=FCGI_NULL_REQUEST_ID):
+ self.version = FCGI_VERSION_1
+ self.type = type
+ self.requestId = requestId
+ self.contentLength = 0
+ self.paddingLength = 0
+ self.contentData = ''
+
+ def _recvall(sock, length):
+ """
+ Attempts to receive length bytes from a socket, blocking if necessary.
+ (Socket may be blocking or non-blocking.)
+ """
+ dataList = []
+ recvLen = 0
+ while length:
+ try:
+ data = sock.recv(length)
+ except socket.error, e:
+ if e[0] == errno.EAGAIN:
+ select.select([sock], [], [])
+ continue
+ else:
+ raise
+ if not data: # EOF
+ break
+ dataList.append(data)
+ dataLen = len(data)
+ recvLen += dataLen
+ length -= dataLen
+ return ''.join(dataList), recvLen
+ _recvall = staticmethod(_recvall)
+
+ def read(self, sock):
+ """Read and decode a Record from a socket."""
+ try:
+ header, length = self._recvall(sock, FCGI_HEADER_LEN)
+ except:
+ raise EOFError
+
+ if length < FCGI_HEADER_LEN:
+ raise EOFError
+
+ self.version, self.type, self.requestId, self.contentLength, \
+ self.paddingLength = struct.unpack(FCGI_Header, header)
+
+ if __debug__: _debug(9, 'read: fd = %d, type = %d, requestId = %d, '
+ 'contentLength = %d' %
+ (sock.fileno(), self.type, self.requestId,
+ self.contentLength))
+
+ if self.contentLength:
+ try:
+ self.contentData, length = self._recvall(sock,
+ self.contentLength)
+ except:
+ raise EOFError
+
+ if length < self.contentLength:
+ raise EOFError
+
+ if self.paddingLength:
+ try:
+ self._recvall(sock, self.paddingLength)
+ except:
+ raise EOFError
+
+ def _sendall(sock, data):
+ """
+ Writes data to a socket and does not return until all the data is sent.
+ """
+ length = len(data)
+ while length:
+ try:
+ sent = sock.send(data)
+ except socket.error, e:
+ if e[0] == errno.EAGAIN:
+ select.select([], [sock], [])
+ continue
+ else:
+ raise
+ data = data[sent:]
+ length -= sent
+ _sendall = staticmethod(_sendall)
+
+ def write(self, sock):
+ """Encode and write a Record to a socket."""
+ self.paddingLength = -self.contentLength & 7
+
+ if __debug__: _debug(9, 'write: fd = %d, type = %d, requestId = %d, '
+ 'contentLength = %d' %
+ (sock.fileno(), self.type, self.requestId,
+ self.contentLength))
+
+ header = struct.pack(FCGI_Header, self.version, self.type,
+ self.requestId, self.contentLength,
+ self.paddingLength)
+ self._sendall(sock, header)
+ if self.contentLength:
+ self._sendall(sock, self.contentData)
+ if self.paddingLength:
+ self._sendall(sock, '\x00'*self.paddingLength)
+
+class FCGIApp(object):
+ def __init__(self, command=None, connect=None, host=None, port=None,
+ filterEnviron=True):
+ if host is not None:
+ assert port is not None
+ connect=(host, port)
+
+ assert (command is not None and connect is None) or \
+ (command is None and connect is not None)
+
+ self._command = command
+ self._connect = connect
+
+ self._filterEnviron = filterEnviron
+
+ #sock = self._getConnection()
+ #print self._fcgiGetValues(sock, ['FCGI_MAX_CONNS', 'FCGI_MAX_REQS', 'FCGI_MPXS_CONNS'])
+ #sock.close()
+
+ def __call__(self, environ, start_response):
+ # For sanity's sake, we don't care about FCGI_MPXS_CONN
+ # (connection multiplexing). For every request, we obtain a new
+ # transport socket, perform the request, then discard the socket.
+ # This is, I believe, how mod_fastcgi does things...
+
+ sock = self._getConnection()
+
+ # Since this is going to be the only request on this connection,
+ # set the request ID to 1.
+ requestId = 1
+
+ # Begin the request
+ rec = Record(FCGI_BEGIN_REQUEST, requestId)
+ rec.contentData = struct.pack(FCGI_BeginRequestBody, FCGI_RESPONDER, 0)
+ rec.contentLength = FCGI_BeginRequestBody_LEN
+ rec.write(sock)
+
+ # Filter WSGI environ and send it as FCGI_PARAMS
+ if self._filterEnviron:
+ params = self._defaultFilterEnviron(environ)
+ else:
+ params = self._lightFilterEnviron(environ)
+ # TODO: Anything not from environ that needs to be sent also?
+ self._fcgiParams(sock, requestId, params)
+ self._fcgiParams(sock, requestId, {})
+
+ # Transfer wsgi.input to FCGI_STDIN
+ content_length = int(environ.get('CONTENT_LENGTH') or 0)
+ while True:
+ chunk_size = min(content_length, 4096)
+ s = environ['wsgi.input'].read(chunk_size)
+ content_length -= len(s)
+ rec = Record(FCGI_STDIN, requestId)
+ rec.contentData = s
+ rec.contentLength = len(s)
+ rec.write(sock)
+
+ if not s: break
+
+ # Empty FCGI_DATA stream
+ rec = Record(FCGI_DATA, requestId)
+ rec.write(sock)
+
+ # Main loop. Process FCGI_STDOUT, FCGI_STDERR, FCGI_END_REQUEST
+ # records from the application.
+ result = []
+ while True:
+ inrec = Record()
+ inrec.read(sock)
+ if inrec.type == FCGI_STDOUT:
+ if inrec.contentData:
+ result.append(inrec.contentData)
+ else:
+ # TODO: Should probably be pedantic and no longer
+ # accept FCGI_STDOUT records?
+ pass
+ elif inrec.type == FCGI_STDERR:
+ # Simply forward to wsgi.errors
+ environ['wsgi.errors'].write(inrec.contentData)
+ elif inrec.type == FCGI_END_REQUEST:
+ # TODO: Process appStatus/protocolStatus fields?
+ break
+
+ # Done with this transport socket, close it. (FCGI_KEEP_CONN was not
+ # set in the FCGI_BEGIN_REQUEST record we sent above. So the
+ # application is expected to do the same.)
+ sock.close()
+
+ result = ''.join(result)
+
+ # Parse response headers from FCGI_STDOUT
+ status = '200 OK'
+ headers = []
+ pos = 0
+ while True:
+ eolpos = result.find('\n', pos)
+ if eolpos < 0: break
+ line = result[pos:eolpos-1]
+ pos = eolpos + 1
+
+ # strip in case of CR. NB: This will also strip other
+ # whitespace...
+ line = line.strip()
+
+ # Empty line signifies end of headers
+ if not line: break
+
+ # TODO: Better error handling
+ header, value = line.split(':', 1)
+ header = header.strip().lower()
+ value = value.strip()
+
+ if header == 'status':
+ # Special handling of Status header
+ status = value
+ if status.find(' ') < 0:
+ # Append a dummy reason phrase if one was not provided
+ status += ' FCGIApp'
+ else:
+ headers.append((header, value))
+
+ result = result[pos:]
+
+ # Set WSGI status, headers, and return result.
+ start_response(status, headers)
+ return [result]
+
+ def _getConnection(self):
+ if self._connect is not None:
+ # The simple case. Create a socket and connect to the
+ # application.
+ if type(self._connect) is str:
+ sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+ else:
+ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ sock.connect(self._connect)
+ return sock
+
+ # To be done when I have more time...
+ raise NotImplementedError, 'Launching and managing FastCGI programs not yet implemented'
+
+ def _fcgiGetValues(self, sock, vars):
+ # Construct FCGI_GET_VALUES record
+ outrec = Record(FCGI_GET_VALUES)
+ data = []
+ for name in vars:
+ data.append(encode_pair(name, ''))
+ data = ''.join(data)
+ outrec.contentData = data
+ outrec.contentLength = len(data)
+ outrec.write(sock)
+
+ # Await response
+ inrec = Record()
+ inrec.read(sock)
+ result = {}
+ if inrec.type == FCGI_GET_VALUES_RESULT:
+ pos = 0
+ while pos < inrec.contentLength:
+ pos, (name, value) = decode_pair(inrec.contentData, pos)
+ result[name] = value
+ return result
+
+ def _fcgiParams(self, sock, requestId, params):
+ rec = Record(FCGI_PARAMS, requestId)
+ data = []
+ for name,value in params.items():
+ data.append(encode_pair(name, value))
+ data = ''.join(data)
+ rec.contentData = data
+ rec.contentLength = len(data)
+ rec.write(sock)
+
+ _environPrefixes = ['SERVER_', 'HTTP_', 'REQUEST_', 'REMOTE_', 'PATH_',
+ 'CONTENT_']
+ _environCopies = ['SCRIPT_NAME', 'QUERY_STRING', 'AUTH_TYPE']
+ _environRenames = {}
+
+ def _defaultFilterEnviron(self, environ):
+ result = {}
+ for n in environ.keys():
+ for p in self._environPrefixes:
+ if n.startswith(p):
+ result[n] = environ[n]
+ if n in self._environCopies:
+ result[n] = environ[n]
+ if n in self._environRenames:
+ result[self._environRenames[n]] = environ[n]
+
+ return result
+
+ def _lightFilterEnviron(self, environ):
+ result = {}
+ for n in environ.keys():
+ if n.upper() == n:
+ result[n] = environ[n]
+ return result
+
+if __name__ == '__main__':
+ from flup.server.ajp import WSGIServer
+ app = FCGIApp(connect=('localhost', 4242))
+ #import paste.lint
+ #app = paste.lint.middleware(app)
+ WSGIServer(app).run()
View
176 python-thirdparty/flup/flup/client/scgi_app.py
@@ -0,0 +1,176 @@
+# Copyright (c) 2006 Allan Saddi <allan@saddi.com>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $Id: scgi_app.py 2111 2006-11-25 02:00:21Z asaddi $
+
+__author__ = 'Allan Saddi <allan@saddi.com>'
+__version__ = '$Revision: 2111 $'
+
+import select
+import struct
+import socket
+import errno
+
+__all__ = ['SCGIApp']
+
+def encodeNetstring(s):
+ return ''.join([str(len(s)), ':', s, ','])
+
+class SCGIApp(object):
+ def __init__(self, connect=None, host=None, port=None,
+ filterEnviron=True):
+ if host is not None:
+ assert port is not None
+ connect=(host, port)
+
+ assert connect is not None
+ self._connect = connect
+
+ self._filterEnviron = filterEnviron
+
+ def __call__(self, environ, start_response):
+ sock = self._getConnection()
+
+ outfile = sock.makefile('w')
+ infile = sock.makefile('r')
+
+ sock.close()
+
+ # Filter WSGI environ and send as request headers
+ if self._filterEnviron:
+ headers = self._defaultFilterEnviron(environ)
+ else:
+ headers = self._lightFilterEnviron(environ)
+ # TODO: Anything not from environ that needs to be sent also?
+
+ content_length = int(environ.get('CONTENT_LENGTH') or 0)
+ if headers.has_key('CONTENT_LENGTH'):
+ del headers['CONTENT_LENGTH']
+
+ headers_out = ['CONTENT_LENGTH', str(content_length), 'SCGI', '1']
+ for k,v in headers.items():
+ headers_out.append(k)
+ headers_out.append(v)
+ headers_out.append('') # For trailing NUL
+ outfile.write(encodeNetstring('\x00'.join(headers_out)))
+
+ # Transfer wsgi.input to outfile
+ while True:
+ chunk_size = min(content_length, 4096)
+ s = environ['wsgi.input'].read(chunk_size)
+ content_length -= len(s)
+ outfile.write(s)
+
+ if not s: break
+
+ outfile.close()
+
+ # Read result from SCGI server
+ result = []
+ while True:
+ buf = infile.read(4096)
+ if not buf: break
+
+ result.append(buf)
+
+ infile.close()
+
+ result = ''.join(result)
+
+ # Parse response headers
+ status = '200 OK'
+ headers = []
+ pos = 0
+ while True:
+ eolpos = result.find('\n', pos)
+ if eolpos < 0: break
+ line = result[pos:eolpos-1]
+ pos = eolpos + 1
+
+ # strip in case of CR. NB: This will also strip other
+ # whitespace...
+ line = line.strip()
+
+ # Empty line signifies end of headers
+ if not line: break
+
+ # TODO: Better error handling
+ header, value = line.split(':', 1)
+ header = header.strip().lower()
+ value = value.strip()
+
+ if header == 'status':
+ # Special handling of Status header
+ status = value
+ if status.find(' ') < 0:
+ # Append a dummy reason phrase if one was not provided
+ status += ' SCGIApp'
+ else:
+ headers.append((header, value))
+
+ result = result[pos:]
+
+ # Set WSGI status, headers, and return result.
+ start_response(status, headers)
+ return [result]
+
+ def _getConnection(self):
+ if type(self._connect) is str:
+ sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+ else:
+ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ sock.connect(self._connect)
+ return sock
+
+ _environPrefixes = ['SERVER_', 'HTTP_', 'REQUEST_', 'REMOTE_', 'PATH_',
+ 'CONTENT_']
+ _environCopies = ['SCRIPT_NAME', 'QUERY_STRING', 'AUTH_TYPE']
+ _environRenames = {}
+
+ def _defaultFilterEnviron(self, environ):
+ result = {}
+ for n in environ.keys():
+ for p in self._environPrefixes:
+ if n.startswith(p):
+ result[n] = environ[n]
+ if n in self._environCopies:
+ result[n] = environ[n]
+ if n in self._environRenames:
+ result[self._environRenames[n]] = environ[n]
+
+ return result
+
+ def _lightFilterEnviron(self, environ):
+ result = {}
+ for n in environ.keys():
+ if n.upper() == n:
+ result[n] = environ[n]
+ return result
+
+if __name__ == '__main__':
+ from flup.server.ajp import WSGIServer
+ app = SCGIApp(connect=('localhost', 4000))
+ #import paste.lint
+ #app = paste.lint.middleware(app)
+ WSGIServer(app).run()
View
1 python-thirdparty/flup/flup/server/__init__.py
@@ -0,0 +1 @@
+#
View
201 python-thirdparty/flup/flup/server/ajp.py
@@ -0,0 +1,201 @@
+# Copyright (c) 2005, 2006 Allan Saddi <allan@saddi.com>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $Id: ajp.py 2188 2006-12-05 22:11:45Z asaddi $
+
+"""
+ajp - an AJP 1.3/WSGI gateway.
+
+For more information about AJP and AJP connectors for your web server, see
+<http://jakarta.apache.org/tomcat/connectors-doc/>.
+
+For more information about the Web Server Gateway Interface, see
+<http://www.python.org/peps/pep-0333.html>.
+
+Example usage:
+
+ #!/usr/bin/env python
+ import sys
+ from myapplication import app # Assume app is your WSGI application object
+ from ajp import WSGIServer
+ ret = WSGIServer(app).run()
+ sys.exit(ret and 42 or 0)
+
+See the documentation for WSGIServer for more information.
+
+About the bit of logic at the end:
+Upon receiving SIGHUP, the python script will exit with status code 42. This
+can be used by a wrapper script to determine if the python script should be
+re-run. When a SIGINT or SIGTERM is received, the script exits with status
+code 0, possibly indicating a normal exit.
+
+Example wrapper script:
+
+ #!/bin/sh
+ STATUS=42
+ while test $STATUS -eq 42; do
+ python "$@" that_script_above.py
+ STATUS=$?
+ done
+
+Example workers.properties (for mod_jk):
+
+ worker.list=foo
+ worker.foo.port=8009
+ worker.foo.host=localhost
+ worker.foo.type=ajp13
+
+Example httpd.conf (for mod_jk):
+
+ JkWorkersFile /path/to/workers.properties
+ JkMount /* foo
+
+Note that if you mount your ajp application anywhere but the root ("/"), you
+SHOULD specifiy scriptName to the WSGIServer constructor. This will ensure
+that SCRIPT_NAME/PATH_INFO are correctly deduced.
+"""
+
+__author__ = 'Allan Saddi <allan@saddi.com>'
+__version__ = '$Revision: 2188 $'
+
+import socket
+import logging
+
+from flup.server.ajp_base import BaseAJPServer, Connection
+from flup.server.threadedserver import ThreadedServer
+
+__all__ = ['WSGIServer']
+
+class WSGIServer(BaseAJPServer, ThreadedServer):
+ """
+ AJP1.3/WSGI server. Runs your WSGI application as a persistant program
+ that understands AJP1.3. Opens up a TCP socket, binds it, and then
+ waits for forwarded requests from your webserver.
+
+ Why AJP? Two good reasons are that AJP provides load-balancing and
+ fail-over support. Personally, I just wanted something new to
+ implement. :)
+
+ Of course you will need an AJP1.3 connector for your webserver (e.g.
+ mod_jk) - see <http://jakarta.apache.org/tomcat/connectors-doc/>.
+ """
+ def __init__(self, application, scriptName='', environ=None,
+ multithreaded=True, multiprocess=False,
+ bindAddress=('localhost', 8009), allowedServers=None,
+ loggingLevel=logging.INFO, debug=True, **kw):
+ """
+ scriptName is the initial portion of the URL path that "belongs"
+ to your application. It is used to determine PATH_INFO (which doesn't
+ seem to be passed in). An empty scriptName means your application
+ is mounted at the root of your virtual host.
+
+ environ, which must be a dictionary, can contain any additional
+ environment variables you want to pass to your application.
+
+ bindAddress is the address to bind to, which must be a tuple of
+ length 2. The first element is a string, which is the host name
+ or IPv4 address of a local interface. The 2nd element is the port
+ number.
+
+ allowedServers must be None or a list of strings representing the
+ IPv4 addresses of servers allowed to connect. None means accept
+ connections from anywhere.
+
+ loggingLevel sets the logging level of the module-level logger.
+ """
+ BaseAJPServer.__init__(self, application,
+ scriptName=scriptName,
+ environ=environ,
+ multithreaded=multithreaded,
+ multiprocess=multiprocess,
+ bindAddress=bindAddress,
+ allowedServers=allowedServers,
+ loggingLevel=loggingLevel,
+ debug=debug)
+ for key in ('jobClass', 'jobArgs'):
+ if kw.has_key(key):
+ del kw[key]
+ ThreadedServer.__init__(self, jobClass=Connection, jobArgs=(self,),
+ **kw)
+
+ def run(self):
+ """
+ Main loop. Call this after instantiating WSGIServer. SIGHUP, SIGINT,
+ SIGQUIT, SIGTERM cause it to cleanup and return. (If a SIGHUP
+ is caught, this method returns True. Returns False otherwise.)
+ """
+ self.logger.info('%s starting up', self.__class__.__name__)
+
+ try:
+ sock = self._setupSocket()
+ except socket.error, e:
+ self.logger.error('Failed to bind socket (%s), exiting', e[1])
+ return False
+
+ ret = ThreadedServer.run(self, sock)
+
+ self._cleanupSocket(sock)
+
+ self.logger.info('%s shutting down%s', self.__class__.__name__,
+ self._hupReceived and ' (reload requested)' or '')
+
+ return ret
+
+def factory(global_conf, host=None, port=None, **local):
+ import paste_factory
+ return paste_factory.helper(WSGIServer, global_conf, host, port, **local)
+
+if __name__ == '__main__':
+ def test_app(environ, start_response):
+ """Probably not the most efficient example."""
+ import cgi
+ start_response('200 OK', [('Content-Type', 'text/html')])
+ yield '<html><head><title>Hello World!</title></head>\n' \
+ '<body>\n' \
+ '<p>Hello World!</p>\n' \
+ '<table border="1">'
+ names = environ.keys()
+ names.sort()
+ for name in names:
+ yield '<tr><td>%s</td><td>%s</td></tr>\n' % (
+ name, cgi.escape(`environ[name]`))
+
+ form = cgi.FieldStorage(fp=environ['wsgi.input'], environ=environ,
+ keep_blank_values=1)
+ if form.list:
+ yield '<tr><th colspan="2">Form data</th></tr>'
+
+ for field in form.list:
+ yield '<tr><td>%s</td><td>%s</td></tr>\n' % (
+ field.name, field.value)
+
+ yield '</table>\n' \
+ '</body></html>\n'
+
+ from wsgiref import validate
+ test_app = validate.validator(test_app)
+ # Explicitly set bindAddress to *:8009 for testing.
+ WSGIServer(test_app,
+ bindAddress=('', 8009), allowedServers=None,
+ loggingLevel=logging.DEBUG).run()
View
949 python-thirdparty/flup/flup/server/ajp_base.py
@@ -0,0 +1,949 @@
+# Copyright (c) 2005, 2006 Allan Saddi <allan@saddi.com>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $Id: ajp_base.py 2188 2006-12-05 22:11:45Z asaddi $
+
+__author__ = 'Allan Saddi <allan@saddi.com>'
+__version__ = '$Revision: 2188 $'
+
+import sys
+import socket
+import select
+import struct
+import signal
+import logging
+import errno
+import datetime
+import time
+
+# Unfortunately, for now, threads are required.
+import thread
+import threading
+
+__all__ = ['BaseAJPServer']
+
+class NoDefault(object):
+ pass
+
+# Packet header prefixes.
+SERVER_PREFIX = '\x12\x34'
+CONTAINER_PREFIX = 'AB'
+
+# Server packet types.
+PKTTYPE_FWD_REQ = '\x02'
+PKTTYPE_SHUTDOWN = '\x07'
+PKTTYPE_PING = '\x08'
+PKTTYPE_CPING = '\x0a'
+
+# Container packet types.
+PKTTYPE_SEND_BODY = '\x03'
+PKTTYPE_SEND_HEADERS = '\x04'
+PKTTYPE_END_RESPONSE = '\x05'
+PKTTYPE_GET_BODY = '\x06'
+PKTTYPE_CPONG = '\x09'
+
+# Code tables for methods/headers/attributes.
+methodTable = [
+ None,
+ 'OPTIONS',
+ 'GET',
+ 'HEAD',
+ 'POST',
+ 'PUT',
+ 'DELETE',
+ 'TRACE',
+ 'PROPFIND',
+ 'PROPPATCH',
+ 'MKCOL',
+ 'COPY',
+ 'MOVE',
+ 'LOCK',
+ 'UNLOCK',
+ 'ACL',
+ 'REPORT',
+ 'VERSION-CONTROL',
+ 'CHECKIN',
+ 'CHECKOUT',
+ 'UNCHECKOUT',
+ 'SEARCH',
+ 'MKWORKSPACE',
+ 'UPDATE',
+ 'LABEL',
+ 'MERGE',
+ 'BASELINE_CONTROL',
+ 'MKACTIVITY'
+ ]
+
+requestHeaderTable = [
+ None,
+ 'Accept',
+ 'Accept-Charset',
+ 'Accept-Encoding',
+ 'Accept-Language',
+ 'Authorization',
+ 'Connection',
+ 'Content-Type',
+ 'Content-Length',
+ 'Cookie',
+ 'Cookie2',
+ 'Host',
+ 'Pragma',
+ 'Referer',
+ 'User-Agent'
+ ]
+
+attributeTable = [
+ None,
+ 'CONTEXT',
+ 'SERVLET_PATH',
+ 'REMOTE_USER',
+ 'AUTH_TYPE',
+ 'QUERY_STRING',
+ 'JVM_ROUTE',
+ 'SSL_CERT',
+ 'SSL_CIPHER',
+ 'SSL_SESSION',
+ None, # name follows
+ 'SSL_KEY_SIZE'
+ ]
+
+responseHeaderTable = [
+ None,
+ 'content-type',
+ 'content-language',
+ 'content-length',
+ 'date',
+ 'last-modified',
+ 'location',
+ 'set-cookie',
+ 'set-cookie2',
+ 'servlet-engine',
+ 'status',
+ 'www-authenticate'
+ ]
+
+# The main classes use this name for logging.
+LoggerName = 'ajp-wsgi'
+
+# Set up module-level logger.
+console = logging.StreamHandler()
+console.setLevel(logging.DEBUG)
+console.setFormatter(logging.Formatter('%(asctime)s : %(message)s',
+ '%Y-%m-%d %H:%M:%S'))
+logging.getLogger(LoggerName).addHandler(console)
+del console
+
+class ProtocolError(Exception):
+ """
+ Exception raised when the server does something unexpected or
+ sends garbled data. Usually leads to a Connection closing.
+ """
+ pass
+
+def decodeString(data, pos=0):
+ """Decode a string."""
+ try:
+ length = struct.unpack('>H', data[pos:pos+2])[0]
+ pos += 2
+ if length == 0xffff: # This was undocumented!
+ return '', pos
+ s = data[pos:pos+length]
+ return s, pos+length+1 # Don't forget NUL
+ except Exception, e:
+ raise ProtocolError, 'decodeString: '+str(e)
+
+def decodeRequestHeader(data, pos=0):
+ """Decode a request header/value pair."""
+ try:
+ if data[pos] == '\xa0':
+ # Use table
+ i = ord(data[pos+1])
+ name = requestHeaderTable[i]
+ if name is None:
+ raise ValueError, 'bad request header code'
+ pos += 2
+ else:
+ name, pos = decodeString(data, pos)
+ value, pos = decodeString(data, pos)
+ return name, value, pos
+ except Exception, e:
+ raise ProtocolError, 'decodeRequestHeader: '+str(e)
+
+def decodeAttribute(data, pos=0):
+ """Decode a request attribute."""
+ try:
+ i = ord(data[pos])
+ pos += 1
+ if i == 0xff:
+ # end
+ return None, None, pos
+ elif i == 0x0a:
+ # name follows
+ name, pos = decodeString(data, pos)
+ elif i == 0x0b:
+ # Special handling of SSL_KEY_SIZE.
+ name = attributeTable[i]
+ # Value is an int, not a string.
+ value = struct.unpack('>H', data[pos:pos+2])[0]
+ return name, str(value), pos+2
+ else:
+ name = attributeTable[i]
+ if name is None:
+ raise ValueError, 'bad attribute code'
+ value, pos = decodeString(data, pos)
+ return name, value, pos
+ except Exception, e:
+ raise ProtocolError, 'decodeAttribute: '+str(e)
+
+def encodeString(s):
+ """Encode a string."""
+ return struct.pack('>H', len(s)) + s + '\x00'
+
+def encodeResponseHeader(name, value):
+ """Encode a response header/value pair."""
+ lname = name.lower()
+ if lname in responseHeaderTable:
+ # Use table
+ i = responseHeaderTable.index(lname)
+ out = '\xa0' + chr(i)
+ else:
+ out = encodeString(name)
+ out += encodeString(value)
+ return out
+
+class Packet(object):
+ """An AJP message packet."""
+ def __init__(self):
+ self.data = ''
+ # Don't set this on write, it will be calculated automatically.
+ self.length = 0
+
+ def _recvall(sock, length):
+ """
+ Attempts to receive length bytes from a socket, blocking if necessary.
+ (Socket may be blocking or non-blocking.)
+ """
+ dataList = []
+ recvLen = 0
+ while length:
+ try:
+ data = sock.recv(length)
+ except socket.error, e:
+ if e[0] == errno.EAGAIN:
+ select.select([sock], [], [])
+ continue
+ else:
+ raise
+ if not data: # EOF
+ break
+ dataList.append(data)
+ dataLen = len(data)
+ recvLen += dataLen
+ length -= dataLen
+ return ''.join(dataList), recvLen
+ _recvall = staticmethod(_recvall)
+
+ def read(self, sock):
+ """Attempt to read a packet from the server."""
+ try:
+ header, length = self._recvall(sock, 4)
+ except socket.error:
+ # Treat any sort of socket errors as EOF (close Connection).
+ raise EOFError
+
+ if length < 4:
+ raise EOFError
+
+ if header[:2] != SERVER_PREFIX:
+ raise ProtocolError, 'invalid header'
+
+ self.length = struct.unpack('>H', header[2:4])[0]
+ if self.length:
+ try:
+ self.data, length = self._recvall(sock, self.length)
+ except socket.error:
+ raise EOFError
+
+ if length < self.length:
+ raise EOFError
+
+ def _sendall(sock, data):
+ """
+ Writes data to a socket and does not return until all the data is sent.
+ """
+ length = len(data)
+ while length:
+ try:
+ sent = sock.send(data)
+ except socket.error, e:
+ if e[0] == errno.EAGAIN: