#!/usr/bin/env python
# -*- coding: utf-8 -*-

# If this is a web application, set the remote host here
remotehost = ""

import sys
import os
import dabo

# The loading of the UI needs to happen before the importing of the
# db, biz, and ui packages:
dabo.ui.loadUI("wx")
if sys.platform[:3] == "win":
	dabo.MDI = True

import db
import biz
import ui

from App import App
app = App(SourceURL=remotehost)

app.db = db
app.biz = biz
app.ui = ui

# Make it easy to find any images or other files you put in the resources
# directory.
sys.path.append(os.path.join(app.HomeDirectory, "resources"))

# Set the BasePrefKey for the app
app.BasePrefKey = "%(appName)s"
app.setup()

# Set up a global connection to the database that all bizobjs will share:
app.dbConnection = app.getConnectionByName("%(dbConnectionDef)s")

# Open one or more of the defined forms. A default one was picked by the app
# generator, but you can change that here. Additionally, if form names were
# passed on the command line, they will be opened instead of the default one
# as long as they exist.
app.DefaultForm = ui.Frm%(tableName)s
app.startupForms()

# Start the application event loop:
app.start()
