Skip to content

Commit

Permalink
Rev3831, Fix Stats page compatibility with latest gevent
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcutme committed Jan 30, 2019
1 parent 8447c6d commit c2b879c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions plugins/Stats/StatsPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def formatTableRow(self, row, class_name=""):
else:
formatted = format % val
back.append("<td>%s</td>" % formatted)
return "<tr class='%s'>%s</tr>" % (class_name, "".join(back))
return "<tr class='%s'>%s</tr>" % (class_name.encode("utf8"), "".join(back).encode("utf8"))

def getObjSize(self, obj, hpy=None):
if hpy:
Expand All @@ -39,6 +39,7 @@ def actionStats(self):
from Db import Db
from Crypt import CryptConnection


hpy = None
if self.get.get("size") == "1": # Calc obj size
try:
Expand Down Expand Up @@ -162,9 +163,9 @@ def actionStats(self):
yield "</table>"

# Tor hidden services
yield "<br><br><b>Tor hidden services (status: %s):</b><br>" % main.file_server.tor_manager.status
yield b"<br><br><b>Tor hidden services (status: %s):</b><br>" % main.file_server.tor_manager.status.encode("utf8")
for site_address, onion in main.file_server.tor_manager.site_onions.items():
yield "- %-34s: %s<br>" % (site_address, onion)
yield "- %-34s: %s<br>" % (site_address, onion.encode("utf8"))

# Db
yield "<br><br><b>Db</b>:<br>"
Expand Down
2 changes: 1 addition & 1 deletion src/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Config(object):

def __init__(self, argv):
self.version = "0.6.4"
self.rev = 3829
self.rev = 3831
self.argv = argv
self.action = None
self.pending_changes = {}
Expand Down
2 changes: 1 addition & 1 deletion src/Site/Site.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
class Site(object):

def __init__(self, address, allow_create=True, settings=None):
self.address = re.sub("[^A-Za-z0-9]", "", address) # Make sure its correct address
self.address = str(re.sub("[^A-Za-z0-9]", "", address)) # Make sure its correct address
self.address_hash = hashlib.sha256(self.address).digest()
self.address_short = "%s..%s" % (self.address[:6], self.address[-4:]) # Short address for logging
self.log = logging.getLogger("Site:%s" % self.address_short)
Expand Down

0 comments on commit c2b879c

Please sign in to comment.