Example #1
0
 def create_app(self):
     app = create_app(Testing())
     self.twill = Twill(app)
     return app
Example #2
0
 def create_app(self):
     app = create_app(Testing())
     self.twill = Twill(app)
     return app
Example #3
0
    def load_location(jsonfile):
        f = open('locations4.json')
        json = simplejson.load(f)
        for loc in json:
            loc = loc['fields']
            location = db.Location()
            #'name', 'selfportrait', 'url', 'image', 'address', 'streetmap'
            location.name = unicode(loc['name'])
            location.desc = unicode(loc['selfportrait'])
            location.url = unicode(loc['url'])
            location.address = unicode(loc['address'])
            location.contact = unicode(loc['url'])
            location.save()


if __name__ == "__main__":
    if "test" in sys.argv:
        test()
    else:
        from flask import app
        from flaskext.script import Shell, Server, Manager

        from planlos import create_app
        from planlos.config import Development

        app = create_app(Development())
        manager = Manager(app)
        manager.add_option('-c', '--config', dest='config', required=False)
        setup(manager)
        manager.run()
Example #4
0
    def load_location(jsonfile):
        f = open('locations4.json')
        json = simplejson.load(f)
        for loc in json:
            loc = loc['fields']
            location = db.Location()
            #'name', 'selfportrait', 'url', 'image', 'address', 'streetmap'
            location.name = unicode(loc['name'])
            location.desc = unicode(loc['selfportrait'])
            location.url = unicode(loc['url'])
            location.address = unicode(loc['address'])
            location.contact = unicode(loc['url'])
            location.save()


if __name__ == "__main__":
    if "test" in sys.argv:
        test()
    else:
        from flask import app
        from flask.ext.script import Shell, Server, Manager

        from planlos import create_app
        from planlos.config import Development

        app = create_app(Development())
        manager = Manager(app)
        manager.add_option('-c', '--config', dest='config', required=False)
        setup()
        manager.run()