-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split response and sajax, add to __init__
- Loading branch information
1 parent
1d535f9
commit b1d0938
Showing
4 changed files
with
70 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
import pkg_resources | ||
|
||
|
||
def get_javascript_string(): | ||
return pkg_resources.resource_string('sajax', 'static/js/sajax.js') | ||
from sajax import Sajax | ||
from response import Response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import pkg_resources | ||
import pprint | ||
|
||
|
||
class Sajax: | ||
"""Register Python routes or methods with Sajax.js | ||
Given a set of python routes or FlaskViews, register these routes so that they can be | ||
easily called using dynamically built, route-specific javascript methods. | ||
""" | ||
|
||
def get_js_path(self): | ||
"""Return the path to sajax.js""" | ||
return pkg_resources.resource_string(__name__, 'static/js/sajax.js') | ||
|
||
|
||
def get_js_string(self): | ||
"""Return the string contents of sajax.js""" | ||
pass | ||
|
||
|
||
def register_view(self, view): | ||
"""Register a FlaskView | ||
""" | ||
pprint.pprint(view) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters