Beispiel #1
0
    def setUp(self):
        # initialize the flask app
        app = flask.Flask(__name__)
        app.config["TESTING"] = True
        compressor = Compressor(app)
        self.app = app
        self.compressor = compressor

        # some simple processors
        def test1(content):
            return "FOOBAR" + str(content)

        def test2(content):
            return str(content) + "BARFOO"

        compressor.register_processor(test1)
        compressor.register_processor(test2)

        # our bundle
        bundle = Bundle(
            name="test_bundle",
            assets=[Asset(content="first asset", processors=["test1"]), Asset(content="second asset")],
            processors=["test2"],
        )
        self.bundle = bundle

        compressor.register_bundle(bundle)
Beispiel #2
0
    def setUp(self):
        # initialize the flask app
        app = flask.Flask(__name__)
        app.config["TESTING"] = True
        compressor = Compressor(app)
        self.app = app
        self.compressor = compressor

        # our bundle
        bundle = CSSBundle(name="test_bundle", assets=[Asset(content="first asset"), Asset(content="second asset")])
        self.bundle = bundle

        compressor.register_bundle(bundle)
from werkzeug.contrib.atom import AtomFeed
from BeautifulSoup import BeautifulSoup

locale.setlocale(locale.LC_ALL, ("fr_FR", "UTF-8"))

DEBUG = True
FLATPAGES_AUTO_RELOAD = DEBUG
FLATPAGES_EXTENSION = ".md"
FREEZER_BASE_URL = "https://www.deltalima.net"
FREEZER_DESTINATION = "build"

app = Flask(__name__)
app.config.from_object(__name__)
pages = FlatPages(app)
freezer = Freezer(app)
compressor = Compressor(app)

app.wsgi_app = SharedDataMiddleware(app.wsgi_app, {"/": os.path.join(os.path.dirname(__file__), "static")})


#
# Web assets
#
css_bundle = CSSBundle(
    name="all.css",
    assets=[
        FileAsset("css/normalize.css"),
        Asset(pygments_style_defs()),
        FileAsset("css/styles.less", processors=["lesscss"]),
    ],
    processors=["cssmin"],
Beispiel #4
0
from tweet_tracker_api.getEntities import *
from tweet_tracker_api.utilities import *
from tweet_tracker_api.bot_prob import find_jobs_bot_prob
from tweet_tracker_api.userlimit import *
from tweet_tracker_api.APIErrors import *
import tweet_tracker_api.InvalidUsage
import logging
import cPickle as pickle
import time
"""
Set up basic web stuff
"""
app = Flask(__name__)
app.secret_key = "\x90'\xcbb\xb8L\x16\x0f\xc8\xf0U\x82\xd2\x7f\xc3\x10\xff\x89\x8b\x93\x08<i\x90"

compressor = Compressor(app)  # add Gzip compression

config = json.load(open("config.json", "r"))
config_obj = tweet_tracker_api.APIClass.TweetTrackerAPIClass(config)
tweet_tracker_api.auth.user.setup(config_obj.dist_db.users)
tweet_tracker_api.entities.api_support.setup(config_obj.dist_db.tweets,
                                             config_obj.ram_db.tweets)
tweet_tracker_api.job_management.job.setup(config_obj.dist_db.categories,
                                           config_obj.twython)
tweet_tracker_api.search.api_support.setup(config_obj.dist_db.tweets,
                                           config_obj.ram_db.tweets)
tweet_tracker_api.hdx.api_support.setup(config_obj.dist_db, config_obj.ram_db)
tweet_tracker_api.report_management.report.setup(config_obj.dist_db.reports,
                                                 config_obj.ram_db.reports)
"""
Set up API calls