コード例 #1
0
ファイル: zeugs.py プロジェクト: BackupTheBerlios/zeugs-svn
def slot_gotProg(prog):
    if (prog == "setup"):
        from dbInit import setup
        setup()
        return

    elif (prog == "control"):
        from guiCP import GuiCP
        # Initialize graphical interface
        gui = GuiCP("cp")

    elif (prog == "edit"):
        from guiEditor import GuiEditor
        # Initialize graphical interface
        gui = GuiEditor("editor")

    elif (prog == "sync"):
        from guiSync import GuiSync
        # See if a client database file has been passed on the command line
        filepath = None
        if (len(sys.argv) > 2):
            f = sys.argv[2]
            if f.endswith(".zgn"):
                filepath = f

        # Initialize graphical interface
        gui = GuiSync("sync", filepath)

    elif (prog == "print"):
        from guiPrint import GuiPrint
        # Initialize graphical interface
        gui = GuiPrint("print")

    elif (prog == "cfged"):
        from guiConfigEd import GuiConfigEd
        # Initialize graphical interface
        gui = GuiConfigEd("cfged")

    else:
        return

    # enter event loop
    gui.run()
コード例 #2
0
ファイル: zeugs.py プロジェクト: bopopescu/zeugs-svn
def slot_gotProg(prog):
    if (prog == "setup"):
        from dbInit import setup
        setup()
        return

    elif (prog == "control"):
        from guiCP import GuiCP
        # Initialize graphical interface
        gui = GuiCP("cp")

    elif (prog == "edit"):
        from guiEditor import GuiEditor
        # Initialize graphical interface
        gui = GuiEditor("editor")

    elif (prog == "sync"):
        from guiSync import GuiSync
        # See if a client database file has been passed on the command line
        filepath = None
        if (len(sys.argv) > 2):
            f = sys.argv[2]
            if f.endswith(".zgn"):
                filepath = f

        # Initialize graphical interface
        gui = GuiSync("sync", filepath)

    elif (prog == "print"):
        from guiPrint import GuiPrint
        # Initialize graphical interface
        gui = GuiPrint("print")

    elif (prog == "cfged"):
        from guiConfigEd import GuiConfigEd
        # Initialize graphical interface
        gui = GuiConfigEd("cfged")

    else:
        return

    # enter event loop
    gui.run()
コード例 #3
0
ファイル: zgsetup.py プロジェクト: bopopescu/zeugs-svn
"""Set up the Zeugs control database.

Once the master database server (I assume PostgreSQL) has been
installed and set up, a control database for the Zeugs system must
be created by a superuser. This database is called 'zeugscontrol'.
SQL:
   CREATE DATABASE zeugscontrol ENCODING 'UTF8';

Then this script must be run to initialize this control database.

Remember that the postgres configuration file pg_hba.conf must also
be set up (and postgres restarted), to get the desired authentication.
Change 'trust' to 'md5', and if network access is desired, add this.
"""

# Add module directories to search path
import sys, os.path
thisDir = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(thisDir, "zgcommon"))
sys.path.append(os.path.join(thisDir, "zgcp"))
sys.path.append(os.path.join(thisDir, "gui"))

import gettext
gettext.install('zeugs', 'i18n', unicode=1)

import framework
from dbInit import setup

if __name__ == "__main__":
    setup()
コード例 #4
0
ファイル: zgsetup.py プロジェクト: BackupTheBerlios/zeugs-svn
Once the master database server (I assume PostgreSQL) has been
installed and set up, a control database for the Zeugs system must
be created by a superuser. This database is called 'zeugscontrol'.
SQL:
   CREATE DATABASE zeugscontrol ENCODING 'UTF8';

Then this script must be run to initialize this control database.

Remember that the postgres configuration file pg_hba.conf must also
be set up (and postgres restarted), to get the desired authentication.
Change 'trust' to 'md5', and if network access is desired, add this.
"""

# Add module directories to search path
import sys, os.path
thisDir = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(thisDir, "zgcommon"))
sys.path.append(os.path.join(thisDir, "zgcp"))
sys.path.append(os.path.join(thisDir, "gui"))

import gettext
gettext.install('zeugs', 'i18n', unicode=1)

import framework
from dbInit import setup


if __name__ == "__main__":
    setup()