![]() ![]() Get ( '', "DeviceMountPaths" ) for test in mountpaths : print ( "paths: " + test ) else : print ( "unmounted" ) except : print ( "DeviceIsMounted is unset" ) try : is_media_available = device_props. Get ( '', "DeviceMountedByUid" ) if mounted_uid = uid : print ( "mounted by me" ) else : print ( "mounted by " + str ( mounted_uid )) mountpaths = device_props. Get ( '', "DeviceIsMounted" ) if is_mounted : mounted_uid = device_props. Get ( '', "NativePath" )) except : print ( "NativePath: is unset" ) try : is_mounted = device_props. Get ( '', "DeviceFile" )) except : print ( "DeviceFile is unset" ) try : print ( "NativePath: " + device_props. # Attempts to get a prop that is no longer set will generate a nnection:Exception # try : print ( "DeviceFile:" + device_props. anything after this may or may not be defined depending on the event and state of the drive. get_object ( "", device ) device_props = dbus. Import os import dbus from import DBusGMainLoop import gobject uid = None def device_added ( device ): print ( "-added-" ) device_dump ( device ) def device_removed ( device ): print ( "-removed-" ) print ( str ( device )) device_dump ( device ) pass def device_changed ( device ): print ( "-changed-" ) device_dump ( device ) pass def device_dump ( device ): device_obj = system_bus.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |