# 3.0 of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public # License along with this program. from lihub import create_app from lihub.maintain.ipkimport import * from lihub.maintain.update_indices import * from lihub.extensions import db app = create_app() db.init_app(app) def main(): incoming_dir = app.config['PKG_INCOMING_DIR'] with app.app_context(): imp = IPKImporter(incoming_dir) imp.import_packages() idx = IndicesUpdater() idx.rebuild_indices() if __name__ == "__main__": main()
try: from lihub.local_config import DefaultConfig except: from lihub.config import DefaultConfig if not os.path.isdir(DefaultConfig.INSTANCE_FOLDER_PATH): raise Exception( "Tried to load default configuration, but it's path doesn't exist. This is usually a configuration issue, you probably wanted to load a local configuration." ) try: from flask_frozen import Freezer except: pass app = create_app() manager = Manager(app) @manager.command def run(): """Run on local machine.""" app.run() @manager.command def freeze(): """Create a static version of the LimbaHub HTML pages.""" freezer = Freezer(app)
def create_app(self): """Create and return a testing flask app.""" app = create_app(TestConfig) self.twill = Twill(app, port=3000) return app