width: 70px;
text-align: right;
}
+
+ul.sources li {
+ font-family: courier;
+ list-style-type: none;
+}
#!/usr/bin/python
import random
-import simplejson
-from helpers import Item, _stringify
+from helpers import Item, _stringify, json_loads
class Banners(object):
def __init__(self, filename=None):
data = f.read()
f.close()
- for item in simplejson.loads(data):
+ for item in json_loads(data):
self.items.append(Item(**_stringify(item)))
def get(self):
#!/usr/bin/python
+import simplejson
import subprocess
class Item(object):
def __setitem__(self, key, val):
self.args[key] = val
-
def size(s):
suffixes = ["B", "K", "M", "G", "T",]
idx += 1
return "%.0f%s" % (s, suffixes[idx])
-
+
+def json_loads(s):
+ return simplejson.loads(s.decode("utf-8"))
+
def _stringify(d):
ret = {}
for key in d.keys():
#!/usr/bin/python
-import simplejson
+from helpers import json_loads
class Info(dict):
def __init__(self, filename):
def load(self, filename):
f = open(filename)
- for key, val in simplejson.loads(f.read()).items():
+ for key, val in json_loads(f.read()).items():
self[key] = val
f.close()
import tornado.httpclient
import random
-import simplejson
import threading
import time
-from helpers import Item, _stringify, ping
+from helpers import Item, _stringify, ping, json_loads
class Mirrors(threading.Thread):
def __init__(self, filename):
data = f.read()
f.close()
- for item in simplejson.loads(data):
+ for item in json_loads(data):
self.items.append(MirrorItem(**_stringify(item)))
@property
#!/usr/bin/python
-import simplejson
-
-from .helpers import Item, _stringify
+from helpers import Item, _stringify, json_loads
class News(object):
def __init__(self, filename=None):
data = data.replace("\n", "").replace("\t", " ")
- json = simplejson.loads(data)
+ json = json_loads(data)
for key in sorted(json.keys()):
self.items.append(NewsItem(**_stringify(json[key])))
#!/usr/bin/python
-import simplejson
-
-from helpers import Item, _stringify
+from helpers import Item, _stringify, json_loads
class ReleaseItem(Item):
options = {
data = f.read()
f.close()
- for item in simplejson.loads(data):
+ for item in json_loads(data):
self.items.append(ReleaseItem(**_stringify(item)))
@property