예제 #1
0
    def __init__(self, *args, **kwds):
        kwds["style"] = wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)
        self.splitter = ProportionalSplitter(
            self)  #, style=wx.SP_3D|wx.SP_BORDER)
        self.panel = wx.Panel(self.splitter)
        self.notebook = wx.Notebook(self.panel, -1, style=wx.NB_BOTTOM)
        self.project_notebook_pane = wx.Panel(self.notebook,
                                              -1,
                                              style=wx.TAB_TRAVERSAL)
        self.SetIcon(wx.Icon(consts.fileIco, wx.BITMAP_TYPE_ICO))
        self.statusbar = self.CreateStatusBar(1, 0)

        # Side Buttons
        self.buttonPanel = wx.Panel(self)
        self.downloadButton = buttons.GenBitmapTextButton(
            self.buttonPanel, -1, wx.Bitmap(consts.icon_download),
            _("Download"))  #, size=(95, 25))
        self.updatesButton = buttons.GenBitmapTextButton(
            self.buttonPanel, -1, wx.Bitmap(consts.icon_updates),
            _("Get Updates"))  #, size=(95, 25))
        self.refreshButton = buttons.GenBitmapTextButton(
            self.buttonPanel, -1, wx.Bitmap(consts.icon_refresh),
            _("Refresh"))  #, size=(95, 25))
        #self.updateStatusButton = buttons.GenBitmapTextButton(self.buttonPanel, -1, wx.Bitmap(consts.icon_refresh), _("Update Status"))#, size=(95, 25))

        self.notebook_il = wx.ImageList(16, 16)
        self.notebook_il.Add(wx.Bitmap(consts.icon_project_details))
        self.notebook.SetImageList(self.notebook_il)

        self.projectDetails = wx.TextCtrl(self.project_notebook_pane,
                                          style=wx.TE_MULTILINE | wx.TE_RICH
                                          | wx.TE_READONLY)
        self.details = detailsTab(self.notebook)

        # Create list view
        self.list = VirtualList(self.splitter, self.details)

        # Create Popup menu for self.list
        self.__popup_menu()
        self.__create_menu()
        self.__set_properties()
        self.__do_layout()
        self.__bind_events()

        plugins.load(consts.dirPlugins, self)
        for name, instance, type, ver in plugins.InterfacePluginList:
            instance.start()

        if len(plugins.OSPluginList) < 1:
            wx.MessageBox(
                _("No OS plugins were loaded. Make sure you have OS plugins in "
                  ) + consts.dirPlugins + ". " +
                _("Check the log for more details."))
            sys.exit(1)
예제 #2
0
파일: main.py 프로젝트: rizaumami/keryx
    def __init__(self, *args, **kwds):
        kwds["style"] = wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)
        self.splitter = ProportionalSplitter(self)#, style=wx.SP_3D|wx.SP_BORDER)
        self.panel = wx.Panel(self.splitter)
        self.notebook = wx.Notebook(self.panel, -1, style=wx.NB_BOTTOM)
        self.project_notebook_pane = wx.Panel(self.notebook, -1, style=wx.TAB_TRAVERSAL)
        self.SetIcon(wx.Icon(consts.fileIco, wx.BITMAP_TYPE_ICO))
        self.statusbar = self.CreateStatusBar(1, 0)

        # Side Buttons
        self.buttonPanel = wx.Panel(self)
        self.downloadButton = buttons.GenBitmapTextButton(self.buttonPanel, -1, wx.Bitmap(consts.icon_download), _("Download"))#, size=(95, 25))
        self.updatesButton = buttons.GenBitmapTextButton(self.buttonPanel, -1, wx.Bitmap(consts.icon_updates), _("Get Updates"))#, size=(95, 25))
        self.refreshButton = buttons.GenBitmapTextButton(self.buttonPanel, -1, wx.Bitmap(consts.icon_refresh), _("Refresh"))#, size=(95, 25))
        #self.updateStatusButton = buttons.GenBitmapTextButton(self.buttonPanel, -1, wx.Bitmap(consts.icon_refresh), _("Update Status"))#, size=(95, 25))

        self.notebook_il = wx.ImageList(16, 16)
        self.notebook_il.Add(wx.Bitmap(consts.icon_project_details))
        self.notebook.SetImageList(self.notebook_il)

        self.projectDetails = wx.TextCtrl(self.project_notebook_pane, style = wx.TE_MULTILINE | wx.TE_RICH |wx.TE_READONLY)
        self.details = detailsTab(self.notebook)

        # Create list view
        self.list = VirtualList(self.splitter, self.details)

        # Create Popup menu for self.list
        self.__popup_menu()
        self.__create_menu()
        self.__set_properties()
        self.__do_layout()
        self.__bind_events()

        plugins.load(consts.dirPlugins, self)
        for name, instance, type, ver in plugins.InterfacePluginList: instance.start()

        if len(plugins.OSPluginList) < 1:
            wx.MessageBox(_("No OS plugins were loaded. Make sure you have OS plugins in ") +
                          consts.dirPlugins + ". " + _("Check the log for more details."))
            sys.exit(1)
예제 #3
0
파일: keryx.py 프로젝트: rizaumami/keryx
if ('--version' in sys.argv) or ('-v' in sys.argv):
    log.info('%s %s' % (consts.appName, consts.appVersion))
    sys.exit(0)

if ('--create' in sys.argv):
    import platform
    from lib import plugins, project
    try:
        index = sys.argv.index('--create')
        name = sys.argv[index + 1]
        plugin_name = 'debian'
    except:
        log.error(_('Unable to create project'))
        sys.exit(1)
    plugins.load(consts.dirPlugins, '', False) # Don't load interface plugins
    for item in range(0,len(plugins.OSPluginList)):
        if plugin_name == plugins.OSPluginList[item][0].lower():
            # Append new project
            project.projects.append(project.Project())
            proj = project.projects[len(project.projects) - 1]
    
            # Create project
            success, filename = proj.CreateKeryx(name, 
                                            plugins.OSPluginList[item][0],
                                            plugins.OSPluginList[item][1])

            if success: 
                log.info(_('Project created successfully.'))
                sys.exit(0)
    log.error(_('Unable to create project.'))