def main(): import sys from device import Device device = Device.generate_device([5, 'allow id 1d6b:0002 serial "0000:00:14.0" name "xHCI Host Controller" hash "Miigb8mx72Z0q6L+YMai0mDZSlYC8qiSMctoUjByF2o=" parent-hash "G1ehGQdrl3dJ9HvW9w2HdC//pk87pKzFE1WY25bq8k4=" via-port "usb1" with-interface 09:00:00']) usbguard_dbus = USBGuardDBUS() app = USBGuardNewDeviceApplication(device, usbguard_dbus) exit_status = app.run() sys.exit(exit_status)
def __init__(self): self.device_policy_changed_ids = [] Notify.init(APPINDICATOR_ID) self.indicator = AppIndicator3.Indicator.new( APPINDICATOR_ID, self.USBGUARD_ICON_PATH, AppIndicator3.IndicatorCategory.SYSTEM_SERVICES) self.indicator.set_status(AppIndicator3.IndicatorStatus.ACTIVE) self.update_menu() self.usbguard_dbus = USBGuardDBUS.get_instance() self.usbguard_dbus.register_device_presence_changed_callback( self.new_device_callback) self.screensaver_dbus = ScreensaverDBUS.get_instance() self.screensaver_dbus.register_screensaver_active_changed_callback( self.screensaver_active_changed_callback)
def __init__(self): Gtk.Application.__init__(self, application_id=self.APPLICATION_ID) self.usbguard_dbus = USBGuardDBUS.get_instance() self.window = None