Jason R. Coombs avatar Jason R. Coombs committed 40433e6

Cleaned up imports

Comments (0)

Files changed (1)


 import cherrypy
 import string
 import posixpath
-from random import shuffle
+import random
 import calendar
 import datetime
 import textwrap
-from cgi import escape
+import cgi
 import pkg_resources
 import jinja2.loaders
-from jinja2 import Environment
 import pytz
 from jaraco.util.numbers import ordinalth as th_it
 import pmxbot.logging
 import pmxbot.util
-jenv = Environment(loader=jinja2.loaders.PackageLoader('pmxbot.web'))
+jenv = jinja2.Environment(loader=jinja2.loaders.PackageLoader('pmxbot.web'))
 colors = ["06F", "900", "093", "F0C", "C30", "0C9", "666", "C90", "C36",
 	"F60", "639", "630", "966", "69C", "039", '7e1e9c', '15b01a', '0343df',
 	'ff81c0', '653700', 'e50000', '029386', 'f97306', 'c20078', '75bbfd']
 def get_context():
 	c = cherrypy.request.app.config['botconf']['config']
 		db = log_db()
 		context = get_context()
 		day_logs = db.get_day_logs(channel, day)
-		data = [(t, n, make_anchor((t, n)), escape(m))
+		data = [(t, n, make_anchor((t, n)), cgi.escape(m))
 			for (t,n,m) in day_logs]
 		usernames = [x[1] for x in data]
 		color_map = {}
-				escape(last['message'][:75]),
+				cgi.escape(last['message'][:75]),
 				make_anchor([last['datetime'].time(), last['nick']]),
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.