Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pattern/db/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import re
import urllib
import base64
import json
import csv as csvlib

from codecs import BOM_UTF8
Expand Down Expand Up @@ -1836,10 +1837,10 @@ def dumps(self, obj, *args, **kwargs):
return "[%s]" % ", ".join(self.dumps(v) for v in obj)
raise TypeError("can't process %s." % type(obj))

try: import json # Python 2.6+
# Try to install JSON library, otherwise use fallback routine
try:
import json
except:
try: from pattern.web import json # simplejson
except:
json = json()

#db = Database("test")
Expand Down
25 changes: 7 additions & 18 deletions pattern/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@
import itertools
import collections
import sqlite3 as sqlite
import cherrypy as cp

try:
import json
json.encoder.FLOAT_REPR = lambda f: ("%.2f" % f)
except AttributeError:
pass

try: # Python 2.x vs 3.x
import htmlentitydefs
Expand Down Expand Up @@ -65,24 +72,6 @@
except:
SCRIPT = os.getcwd()

try:
# Import from python2.x/site-packages/cherrypy
import cherrypy; cp=cherrypy
except:
# Import from pattern/server/cherrypy/cherrypy
# Bundled package is "hidden" in a non-package folder,
# otherwise it conflicts with site-packages/cherrypy.
sys.path.insert(0, os.path.join(MODULE, "cherrypy"))
import cherrypy; cp=cherrypy

try: import json # Python 2.6+
except:
try: from pattern.web import json # simplejson
except:
json = None

json.encoder.FLOAT_REPR = lambda f: ("%.2f" % f)

def chown(path, owner=None):
""" Changes the ownership of the given file to the given (user, group).
Returns True if successful.
Expand Down
25 changes: 0 additions & 25 deletions pattern/server/cherrypy/cherrypy/LICENSE.txt

This file was deleted.

Loading