Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/web.py

Issue 5744805892063232: Issue 1374 - Don`t hardcode web handlers for multiplexer (Closed)
Patch Set: Changed option name transformation Created Sept. 18, 2014, 7:11 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sitescripts/utils.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/web.py
===================================================================
--- a/sitescripts/web.py
+++ b/sitescripts/web.py
@@ -11,16 +11,17 @@
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
import base64
+import importlib
from sitescripts.utils import get_config
handlers = {}
authenticated_users = {}
def url_handler(url):
def decorator(func):
registerUrlHandler(url, func)
@@ -51,18 +52,10 @@ def authenticate(f, environ, start_respo
if username == expected_username and password == expected_password:
return f(environ, start_response)
realm = get_config().get("DEFAULT", "basic_auth_realm")
start_response("401 UNAUTHORIZED",
[("WWW-Authenticate", 'Basic realm="%s"' % realm)])
return ""
-import subscriptions.web.fallback
-import crashes.web.submitCrash
-import reports.web.submitReport
-import reports.web.updateReport
-import reports.web.showDigest
-import reports.web.showUser
-import formmail.web.formmail
-import crawler.web.crawler
-import urlfixer.web.submitData
-import extensions.web.downloads
+for module in set(get_config().options("multiplexer")) - set(get_config().defaults()):
+ importlib.import_module(module)
« no previous file with comments | « sitescripts/utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld