Skip to content

Commit 6a408a6

Browse files
authored
add GitHub URL for PyPi (webpy#724)
* add GitHub URL for PyPi * autoformat the files
1 parent 06a0b63 commit 6a408a6

File tree

6 files changed

+22
-19
lines changed

6 files changed

+22
-19
lines changed

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
maintainer="Anand Chitipothu",
2222
maintainer_email="anandology@gmail.com",
2323
url="http://webpy.org/",
24+
project_urls={
25+
"Source": "https://github.com/webpy/webpy",
26+
},
2427
packages=["web", "web.contrib"],
2528
install_requires=["cheroot"],
2629
long_description=long_description,

tests/test_application.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ def f(name):
298298
path = "/?" + urlencode({"name": name.encode("utf-8")})
299299
self.assertEqual(app.request(path).data.decode("utf-8"), repr(name))
300300

301-
f(u"\u1234")
302-
f(u"foo")
301+
f("\u1234")
302+
f("foo")
303303

304304
response = app.request("/", method="POST", data=dict(name="foo"))
305305

tests/test_db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def _testable(self):
9393

9494
def testUnicode(self):
9595
# Bug#177265: unicode queries throw errors
96-
self.db.select("person", where="name=$name", vars={"name": u"\xf4"})
96+
self.db.select("person", where="name=$name", vars={"name": "\xf4"})
9797

9898
def assertRows(self, n):
9999
result = self.db.select("person")

tests/test_wsgi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def test_layers_unicode(self):
1616

1717
class uni:
1818
def GET(self):
19-
return u"\u0C05\u0C06"
19+
return "\u0C05\u0C06"
2020

2121
app = web.application(urls, locals())
2222

@@ -27,7 +27,7 @@ def GET(self):
2727
b = web.browser.AppBrowser(app)
2828
r = b.open("/").read()
2929
s = r.decode("utf8")
30-
self.assertEqual(s, u"\u0C05\u0C06")
30+
self.assertEqual(s, "\u0C05\u0C06")
3131

3232
app.stop()
3333
thread.join()

web/net.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,11 @@ def htmlquote(text):
228228
>>> htmlquote(u"<'&\">")
229229
u'&lt;&#39;&amp;&quot;&gt;'
230230
"""
231-
text = text.replace(u"&", u"&amp;") # Must be done first!
232-
text = text.replace(u"<", u"&lt;")
233-
text = text.replace(u">", u"&gt;")
234-
text = text.replace(u"'", u"&#39;")
235-
text = text.replace(u'"', u"&quot;")
231+
text = text.replace("&", "&amp;") # Must be done first!
232+
text = text.replace("<", "&lt;")
233+
text = text.replace(">", "&gt;")
234+
text = text.replace("'", "&#39;")
235+
text = text.replace('"', "&quot;")
236236
return text
237237

238238

@@ -243,11 +243,11 @@ def htmlunquote(text):
243243
>>> htmlunquote(u'&lt;&#39;&amp;&quot;&gt;')
244244
u'<\'&">'
245245
"""
246-
text = text.replace(u"&quot;", u'"')
247-
text = text.replace(u"&#39;", u"'")
248-
text = text.replace(u"&gt;", u">")
249-
text = text.replace(u"&lt;", u"<")
250-
text = text.replace(u"&amp;", u"&") # Must be done last!
246+
text = text.replace("&quot;", '"')
247+
text = text.replace("&#39;", "'")
248+
text = text.replace("&gt;", ">")
249+
text = text.replace("&lt;", "<")
250+
text = text.replace("&amp;", "&") # Must be done last!
251251
return text
252252

253253

@@ -263,7 +263,7 @@ def websafe(val):
263263
True
264264
"""
265265
if val is None:
266-
return u""
266+
return ""
267267

268268
if isinstance(val, bytes):
269269
val = val.decode("utf-8")

web/template.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ def make_env(self, globals, builtins):
889889
)
890890

891891
def _join(self, *items):
892-
return u"".join(items)
892+
return "".join(items)
893893

894894
def _escape(self, value, escape=False):
895895
if value is None:
@@ -1437,7 +1437,7 @@ class TemplateResult(MutableMapping):
14371437

14381438
def __init__(self, *a, **kw):
14391439
self.__dict__["_d"] = dict(*a, **kw)
1440-
self._d.setdefault("__body__", u"")
1440+
self._d.setdefault("__body__", "")
14411441

14421442
self.__dict__["_parts"] = []
14431443
self.__dict__["extend"] = self._parts.extend
@@ -1450,7 +1450,7 @@ def keys(self):
14501450
def _prepare_body(self):
14511451
"""Prepare value of __body__ by joining parts."""
14521452
if self._parts:
1453-
value = u"".join(self._parts)
1453+
value = "".join(self._parts)
14541454
self._parts[:] = []
14551455
body = self._d.get("__body__")
14561456
if body:

0 commit comments

Comments
 (0)