Exemplo n.º 1
0
def main():

    """Main program."""

    description = str(i18n("Simple log file viewer"))
    version = "0.3"
    about = KAboutData("lovi", "lovi", version, description,
        KAboutData.License_GPL, "Copyright (C) 2005-2006 by Akos Polster")
    about.addAuthor("Akos Polster", "", "*****@*****.**")
    KCmdLineArgs.init(sys.argv, about)
    KCmdLineArgs.addCmdLineOptions([("+files", "Files to monitor")])
    app = KApplication()
    mainWindow = MainWin(None, "lovi#")
    app.setMainWidget(mainWindow)
    
    # Get list of monitored files from the command line or from the cfg file
    args = KCmdLineArgs.parsedArgs()
    if args.count() > 0:
        for i in range(0, args.count()):
            mainWindow.monitor(args.arg(i))
    else:
        cfg = app.config()
        cfg.setGroup("Monitor")
        files = cfg.readListEntry("files")
        for f in files:
            mainWindow.monitor(str(f))
        
    mainWindow.show()
    app.exec_loop()
def main():
    aboutData = KAboutData(
        PACKAGE, PROGRAMNAME, VERSION,
        I18N_NOOP("LilyKDE servicemenu helper"),
        KAboutData.License_GPL,
        "Copyright (c) 2008, " + AUTHOR,
        "", HOMEPAGE)
    KCmdLineArgs.init (sys.argv, aboutData)
    KCmdLineArgs.addCmdLineOptions([
        ("+files", I18N_NOOP("LilyPond files to convert"))
        ])
    app = KApplication()
    log = LogWidget()
    app.setMainWidget(log)
    log.setMinimumHeight(240)
    log.setMinimumWidth(400)
    log.setCaption(PROGRAMNAME)
    log.show()

    # get the files to convert
    pa = KCmdLineArgs.parsedArgs()
    files = map(pa.arg, range(pa.count()))

    # start the first job. Itself takes care of running the rest.
    Job(files, log)
    app.exec_loop()
Exemplo n.º 3
0
 def __init__(self, argv, opts):
     KLocale.setMainCatalogue("kdelibs")
     if not '--caption' in argv:
         argv += ['--caption', 'PyQLogger']
         sysargv = argv[:]
         from pyqlogger import VERSION
         aboutData = KAboutData("pyqlogger", "PyQLogger",
                                VERSION, "Blogger GUI",
                                KAboutData.License_GPL,
                                "(C) 2004, Eli Yukelzon", "",
                                "http://pyqlogger.berlios.de",
                                "")
         aboutData.addAuthor("Eli Yukelzon a.k.a Reflog", "",
                             "*****@*****.**")
         aboutData.addAuthor("Xander Soldaat a.k.a Mightor", "",
                             "*****@*****.**")
         try:
             options = [("s",
                         "Status bar (default = disabled)"),
                        ("statusbar",
                         "Status bar (default = disabled)")]
             KCmdLineArgs.init(argv, aboutData)
             KCmdLineArgs.addCmdLineOptions(options)
         except TypeError:
             KCmdLineArgs.init(sysargv, sysargv[0], '', '')
         if opts:
             KCmdLineArgs.addCmdLineOptions(opts)
         KApplication.__init__(self)
Exemplo n.º 4
0
def run_widget(myclass, use_kde=None):
    """ run a qt app using myclass as the main widget.
    This funtion calls sys.exit().
    """
    global HASKDE
    #pk.options.parse_args()
    #if has_kde() and use_kde is None:
    #    use_kde = pk.options.get('use_kde')
    HASKDE = use_kde
    if use_kde:
        from kdecore import KAboutData, KCmdLineArgs, KApplication
        about = KAboutData('A pk app', 'run_widget', '0.1')
        KCmdLineArgs.init(sys.argv, about)
        a = KApplication()
        w = myclass()
        w.show()
        a.exec_()
    else:
        from PyQt4.QtGui import QApplication
        a = QApplication(sys.argv)
        w = myclass()
        w.show()
        sys.exit(a.exec_())
Exemplo n.º 5
0
    programName = 'PyWireless'
    description = 'A Basic Wireless Connection Monitor'
    license = KAboutData.License_GPL_V2
    version = '3.3'
    copyright = '(C) 2005 S.Çağlar Onur <*****@*****.**>'

    aboutData = KAboutData(appName, programName, version, description, license,
                           copyright)

    aboutData.addAuthor('S.Çağlar Onur', 'Maintainer', '*****@*****.**')
    aboutData.addAuthor('Onur Küçük', 'Contributor [Rx/Tx bytes part]',
                        '*****@*****.**')
    aboutData.addAuthor(
        'Serdar Soytetir',
        'Contributor [New PyWireless Icons & UI Improvements]',
        '*****@*****.**')
    aboutData.addAuthor('Furkan Duman', 'Contributor [Bug fix]',
                        '*****@*****.**')

    KCmdLineArgs.init(sys.argv, aboutData)
    ''' Use KUniqueApplication and initialize'''
    gettext.install(appName)
    app = KUniqueApplication(True, True, True)
    trayWindow = SystemTray(None, appName)

    dbus.mainloop.qt3.DBusQtMainLoop(set_as_default=True)

    app.setMainWidget(trayWindow)
    ''' Enter main loop '''
    app.exec_loop()
Exemplo n.º 6
0
def main(argv):
    KCmdLineArgs.init(argv, "ksmarttray", "KSmartTray", "", "")
    app = KUniqueApplication(True, True, False)
    app.dirs().addResourceDir("appicon", app.applicationDirPath())
    smarttray = KSmartTray()
    app.exec_loop()
Exemplo n.º 7
0
#!/usr/bin/python
"""KDE support for dpaste"""
import sys, time
import dcop
import dcopext
from kdecore import KApplication, KCmdLineArgs, KAboutData
from qt import QString, QCString

import StringIO
import dpaster

description = "KDE interface to http://dpaste.com/"
version     = "0.1"
aboutData   = KAboutData ("testdcopext", "testdcopext",\
    version, description, KAboutData.License_GPL,\
    "(C) 2007 Peter Fein")

aboutData.addAuthor ("Peter Fein", "wrote it", "*****@*****.**")

KCmdLineArgs.init (sys.argv, aboutData)

app  = KApplication ()
dcop = app.dcopClient ()

d = dcopext.DCOPApp ("klipper", dcop)
res, content = d.klipper.getClipboardContents()
sio=StringIO.StringIO(content)
url=dpaster.paste(sio)
res=d.klipper.setClipboardContents(url)
        self.tabTorrent.setCurrentPage(-1)

        KPyBTTorrentBaseLayout.addWidget(self.tabTorrent,0,0)

        self.languageChange()

        self.resize(QSize(431,270).expandedTo(self.minimumSizeHint()))
        self.clearWState(Qt.WState_Polished)


    def languageChange(self):
        self.setCaption(self.__tr("Form1"))


    def __tr(self,s,c = None):
        return qApp.translate("KPyBTTorrentBase",s,c)

if __name__ == "__main__":
    appname     = ""
    description = ""
    version     = ""

    KCmdLineArgs.init (sys.argv, appname, description, version)
    a = KApplication ()

    QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
    w = KPyBTTorrentBase()
    a.setMainWidget(w)
    w.show()
    a.exec_loop()
Exemplo n.º 9
0
 def prepareCommandLine():
     args = KCmdLineArgs.parsedArgs()
     return args.isSet("statusbar") or args.isSet("s")
Exemplo n.º 10
0
Arquivo: tab.py Projeto: pipacs/etc
    """
    Monitor a file.
    
    @param  fileName    File to monitor
    """
    def monitor(self, fileName):
        try:
            tailer = Tail(fileName)
        except:
            KMessageBox.error(self, 
                str(i18n("Cannot open file for monitoring:\n%s")) % fileName,
                i18n("Error - lovi"))
            return
        self.tab.addTab(Monitor(tailer), os.path.basename(fileName))

"""
Main program.
"""
description = str(i18n("Simple log file viewer"))
version = "0.1"
about = KAboutData("", "", \
    version, description, KAboutData.License_GPL, \
    "(C) 2005 Akos Polster")
about.addAuthor("Akos Polster", "", "*****@*****.**")
KCmdLineArgs.init(sys.argv, about)
# KCmdLineArgs.addCmdLineOptions([("+files", "File to open")])
app = KApplication()
mainWindow = MainWin(None, "lovi#")
mainWindow.show()
app.exec_loop()
Exemplo n.º 11
0
    @param  fileName    File to monitor
    """

    def monitor(self, fileName):
        try:
            tailer = Tail(fileName)
        except:
            KMessageBox.error(
                self,
                str(i18n("Cannot open file for monitoring:\n%s")) % fileName,
                i18n("Error - lovi"))
            return
        self.tab.addTab(Monitor(tailer), os.path.basename(fileName))


"""
Main program.
"""
description = str(i18n("Simple log file viewer"))
version = "0.1"
about = KAboutData("", "", \
    version, description, KAboutData.License_GPL, \
    "(C) 2005 Akos Polster")
about.addAuthor("Akos Polster", "", "*****@*****.**")
KCmdLineArgs.init(sys.argv, about)
# KCmdLineArgs.addCmdLineOptions([("+files", "File to open")])
app = KApplication()
mainWindow = MainWin(None, "lovi#")
mainWindow.show()
app.exec_loop()
Exemplo n.º 12
0
import sys
from kdecore import KAboutData, KApplication, KCmdLineArgs, KConfigSkeleton
from kdeui import KConfigDialog, KMainWindow

KCmdLineArgs.init(sys.argv, KAboutData("test", "test", "1.0"))
app = KApplication()
mainWin = KMainWindow(None, "test")
app.setMainWidget(mainWin)
cfg = KConfigSkeleton("test")
dlg = KConfigDialog(mainWin, "settings", cfg)
mainWin.show()
app.exec_loop()
Exemplo n.º 13
0
def main(argv):
    KCmdLineArgs.init(argv, "ksmarttray", "KSmartTray", "", "")
    app = KUniqueApplication(True, True, False)
    app.dirs().addResourceDir("appicon", app.applicationDirPath())
    smarttray = KSmartTray()
    app.exec_loop()
Exemplo n.º 14
0
            ch.registerDone(handleState_dhcp)
            ch.registerError(self.comarError)
            ch.registerAuthError(self.comarError)
            ch.registerDBusError(self.busError)
            ch.call()

            ch = self.callMethod("info",
                                 "tr.org.pardus.comar.system.service.set",
                                 "System.Service")
            ch.registerDone(handleState_iptables)
            ch.call()

        else:
            self.groupBox1.setEnabled(True)
            self.buttonGroup2.setEnabled(True)


if __name__ == "__main__":
    appname = ""
    description = ""
    version = ""

    KCmdLineArgs.init(sys.argv, appname, description, version)
    a = KApplication()

    QObject.connect(a, SIGNAL("lastWindowClosed()"), a, SLOT("quit()"))
    w = connShare()
    a.setMainWidget(w)
    w.show()
    a.exec_loop()