Ejemplo n.º 1
0
 def __init__(self, db, table_name):
     self._db = db
     self.table_name = table_name
     self.notifier = Notifier.getInstance()
Ejemplo n.º 2
0
                                % file)
                        else:
                            menu.findOwnerAndAdd(desktop)

                        desktopparser.reset()

                    menu.removeEmptyItems()

                    fd = codecs.open(BBFlux.FLUXBOX_MENU, 'w+', 'UTF-8')
                    fd.write(menu.toFluxBox())
                    fd.close()

                    updated = abs(current - last)
                    message = "BBFlux daemon succesfully updated %d item%s in FluxBox menu." % (
                        updated, "s" if updated > 1 else "")

                    syslog.syslog(message)

                    Notifier.getInstance().notify(message)

                    prev = files

                sleep(BBFlux.WAIT_DELAY)

    except KeyboardInterrupt:
        syslog.syslog(
            'User interrupted BBFlux daemon with a keyboard interrupt.')

    except Exception as e:
        syslog.syslog(syslog.LOG_ERR, str(e))
Ejemplo n.º 3
0
 def __init__(self, db, table_name):
     self._db = db
     self.table_name = table_name
     self.notifier = Notifier.getInstance()
Ejemplo n.º 4
0
            desktop = desktopparser.parse( file )
            if desktop == None:
              syslog.syslog( syslog.LOG_NOTICE, "File '%s' could not be parsed, corrupted content or encoding ." % file )
            else:
              menu.findOwnerAndAdd(desktop)

            desktopparser.reset()

          menu.removeEmptyItems()

          fd = codecs.open( BBFlux.FLUXBOX_MENU, 'w+', 'UTF-8' )
          fd.write( menu.toFluxBox() )
          fd.close()

          updated = abs(current - last)
          message = "BBFlux daemon succesfully updated %d item%s in FluxBox menu." % ( updated, "s" if updated > 1 else "" )

          syslog.syslog( message )

          Notifier.getInstance().notify( message )

          prev = files

        sleep( BBFlux.WAIT_DELAY )
      
  except KeyboardInterrupt:
    syslog.syslog( 'User interrupted BBFlux daemon with a keyboard interrupt.' )

  except Exception as e:
    syslog.syslog( syslog.LOG_ERR, str(e) )