vpackager / src / scripts / vpackager

#!/usr/bin/env python

#    This file is part of vpackager.
#
#    vpackager is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License v3 as published by
#    the Free Software Foundation.
#
#    vpackager 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 vpackager.  If not, see <http://www.gnu.org/licenses/>.


import gtk
from vpackager import bot
from vpackager import vpackager as vp
from vpackager import dbutils
from vpackager import preferences
import sys
import os

def RunBot():
    """run vpackager in bot mode"""
    dbpath = preferences.VPConf().GetSetting('database_home')
    db = dbutils.dbase(os.path.join(dbpath, 'vpackager.db'))
    try:
        db.CreateTables()
    except:
        # Tables already exist
        pass
    db._cleanup_history()
    w = bot.Gui(dbase_model = db)
    return w

def RunSolo():
    """Run the application in single build mode"""
    w = vp.Wizard()
    return w

if __name__ == '__main__':

    if sys.argv[-1] == '-s':
	w = RunSolo()
    else:
	w = RunBot()
    w.show_all()
    gtk.gdk.threads_init()
    gtk.main()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.