summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorblob8108 <blob8108@gmail.com>2014-01-11 12:21:23 +0000
committerblob8108 <blob8108@gmail.com>2014-01-11 12:21:23 +0000
commite324d03e6d929c8adaba0f74f2d80b4052a86fa4 (patch)
tree61f8e97c2afbc291349e5d9fe66bdfa43668e777
parentc07443fcc841ac19565e7a498ceec491f3d1c096 (diff)
downloadblockext-e324d03e6d929c8adaba0f74f2d80b4052a86fa4.tar.gz
blockext-e324d03e6d929c8adaba0f74f2d80b4052a86fa4.zip
Replace ridiculous "optional" argument `is_browser`
-rw-r--r--blockext/__init__.py4
-rw-r--r--blockext/scratch.py2
-rw-r--r--blockext/snap.py2
3 files changed, 3 insertions, 5 deletions
diff --git a/blockext/__init__.py b/blockext/__init__.py
index 40427d7..0581cd3 100644
--- a/blockext/__init__.py
+++ b/blockext/__init__.py
@@ -94,10 +94,8 @@ class Blockext(BaseHTTPRequestHandler):
if isinstance(func, Block):
response = func(*args)
mime_type = "text/plain"
- elif "is_browser" in inspect.getargspec(func).args:
- (mime_type, response) = func(is_browser=is_browser, *args)
else:
- (mime_type, response) = func(*args)
+ (mime_type, response) = func(is_browser=is_browser, *args)
status = 200
else:
response = "ERROR: Not found"
diff --git a/blockext/scratch.py b/blockext/scratch.py
index a812028..34d4d81 100644
--- a/blockext/scratch.py
+++ b/blockext/scratch.py
@@ -24,7 +24,7 @@ BLOCK_SHAPES = {
}
@handler("scratch_{filename}.s2e", display="Download Scratch 2.0 extension")
-def generate_s2e():
+def generate_s2e(is_browser=False):
extension = {
"extensionName": Blockext.name,
"extensionPort": Blockext.port,
diff --git a/blockext/snap.py b/blockext/snap.py
index d3fbe52..75c86d9 100644
--- a/blockext/snap.py
+++ b/blockext/snap.py
@@ -21,7 +21,7 @@ def pretty(stuff):
return xml.toprettyxml()
@handler("snap_{filename}.xml", display="Download Snap! blocks")
-def generate_xml():
+def generate_xml(is_browser=False):
root = Element("blocks", {
"app": "Snap! 4.0, http://snap.berkeley.edu",
"version": "1",