Skip to content

Commit

Permalink
Unused modules and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
onejgordon committed Mar 12, 2017
1 parent 03f8bfc commit 99866be
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 82 deletions.
6 changes: 1 addition & 5 deletions django_version.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import logging, os, sys
import os
os.environ["DJANGO_SETTINGS_MODULE"] = "settings"

#from google.appengine.ext import webapp
import webapp2
#from django.conf import settings
#settings._target = None
11 changes: 0 additions & 11 deletions messages.py

This file was deleted.

6 changes: 0 additions & 6 deletions settings.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>{{ SITENAME }} | Error!</title>
<title>{{ SITENAME }} | Error</title>
<link type="text/css" rel="stylesheet" href="/static/main.css" />
</head>

Expand Down
61 changes: 2 additions & 59 deletions tools.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os, time, random, urllib, string, logging, re, cgi
import os, time, random, string, logging, re, cgi
from datetime import datetime, timedelta, date
from datetime import time as dttime
import hashlib
Expand All @@ -17,6 +17,7 @@ def pluralize(item_name, count=1, suffix='s'):
else:
return item_name + suffix


def on_dev_server():
if 'Development' == os.environ['SERVER_SOFTWARE'][:11]:
return True
Expand Down Expand Up @@ -154,7 +155,6 @@ def is_valid_email(possible_email):
return None



def removeLinebreaks(message):
if message:
message = message.replace('\r','').replace('\n','')
Expand All @@ -170,23 +170,6 @@ def get_first_day(dt, d_years=0, d_months=0):
def get_last_day(dt):
return get_first_day(dt, 0, 1) + timedelta(-1)

def escapejs(value):
_js_escapes = (
('\\', '\\\\'),
('"', '\\"'),
("'", "\\'"),
('\n', '\\n'),
('\r', '\\r'),
('\b', '\\b'),
('\f', '\\f'),
('\t', '\\t'),
('\v', '\\v'),
('</', '<\\/'),
)
for bad, good in _js_escapes:
value = value.replace(bad, good)
return value

html_escape_table = {
"&": "&amp;",
'"': "&quot;",
Expand Down Expand Up @@ -219,18 +202,6 @@ def fromISODate(s, timestamp=False):
return None


def get_session_user(key='agent'):
session = get_current_session()
if session.has_key(key):
return session[key]
else:
return None

def set_session_user(user, key='user'):
session = get_current_session()
session[key] = user
return session

def minutes_in(dt=None):
"# of minutes into the current day"
if dt is None:
Expand Down Expand Up @@ -287,31 +258,6 @@ def week_start():
return start


def dictFromKeys(li):
d = {}
if li:
for key in li:
d[key] = None
return d

def toJson(d):
_json = None
if d:
try:
_json = json.dumps(d)
except Exception, e:
logging.error(e)
return _json

def fromJson(_json):
if _json:
try:
return json.loads(_json)
except:
return {}
else:
return {}

def trunc_chars(text, n=120):
if text and len(text) > n:
return text[:n]+"..."
Expand Down Expand Up @@ -393,9 +339,6 @@ def gets(self, strings=[], lists=[], floats=[], integers=[], booleans=[], dates=
vals[arg] = None
return vals

def containsWord(message, word):
return re.search(r'\b%s\b' % word, message, flags=re.IGNORECASE) is not None


def dedupe(seq, idfun=None):
# order preserving
Expand Down

0 comments on commit 99866be

Please sign in to comment.