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
def api_url_for(endpoint, **values): | |
# probably handle missing api_app key in some | |
# special exception. | |
api_app = current_app().config["api_app"] | |
with api_app.app_context(): | |
return url_for(end_point, **values) | |
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
import os | |
class WSGIApp(object): | |
def __init__(self): | |
setup_logger(os.environ.get('PYCSW_CONFIG')) | |
def __call__(self, env, start_repsonse): | |
""" Do reqeust stuff here """ | |
application = WSGIApp() |
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
existing_hash = {:foo=>"bar"} | |
other_hash.each_pair do |key, value| | |
if some_condition | |
existing_hash[key] = value | |
end | |
end |
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
import os | |
from cStringIO import StringIO | |
import tarfile | |
from flask import Flask, Response | |
app = Flask(__name__) | |
def get_string_io_len(s): |
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
""" | |
For reference wtforms.core.FloatField | |
------------------------------------- | |
class FloatField(Field): | |
widget = widgets.TextInput() | |
def __init__(self, label=None, validators=None, **kwargs): | |
super(FloatField, self).__init__(label, validators, **kwargs) |
NewerOlder