Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate finding and loading jsx_props module #26

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions bottlereact.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

from __future__ import print_function

import collections, ctypes, json, os, random, re, shutil, signal, socket, subprocess, tempfile, threading, time, urllib
import collections, ctypes, importlib, json, os, random, re, shutil, signal, socket, subprocess, tempfile, threading, time, urllib
try:
import bottle
import react.jsx
Expand Down Expand Up @@ -523,11 +523,9 @@ def __init__(self, name, fn):
self.name = name
self.fn = fn
self.default_props = dict
try:
if importlib.util.find_sepc('jsx_props'):
import jsx_props
self.default_props = jsx_props.__dict__.get('init%s'%name, dict)
except ImportError:
pass
def __call__(self, props=None, children=None):
'''
props must be a dict or None
Expand Down