Byron Clark avatar Byron Clark committed f8debf2

Remove dead code.

Comments (0)

Files changed (4)

udiskie/__init__.py

-import dbus
-
-__all__ = ['system_bus']
-
-system_bus = dbus.SystemBus()

udiskie/names.py

-UDISKS_OBJECT = 'org.freedesktop.UDisks'
-UDISKS_OBJECT_PATH = '/org/freedesktop/UDisks'
-
-UDISKS_INTERFACE = 'org.freedesktop.UDisks'
-UDISKS_DEVICE_INTERFACE = 'org.freedesktop.UDisks.Device'
-
-DBUS_PROPS_INTERFACE = 'org.freedesktop.DBus.Properties'

udiskie/umount.py

 
 import dbus
 
-from udiskie import system_bus
-from udiskie.names import UDISKS_OBJECT, UDISKS_DEVICE_INTERFACE
 import udiskie.device
-import udiskie.util
 
 def unmount(path):
     """Unmount a filesystem

udiskie/util.py

-import logging
-
-from udiskie import system_bus
-import udiskie.names as names
-
-def _get_all_devices():
-    obj = system_bus.get_object(names.UDISKS_OBJECT,
-                                names.UDISKS_OBJECT_PATH)
-    return obj.EnumerateDevices(dbus_interface=names.UDISKS_INTERFACE)
-
-def _get_property(device, prop):
-    device_obj = system_bus.get_object(names.UDISKS_OBJECT, device)
-    return device_obj.Get(names.UDISKS_DEVICE_INTERFACE, prop, dbus_interface=names.DBUS_PROPS_INTERFACE)
-
-def find_device(path):
-    logger = logging.getLogger('udiskie.util.find_device')
-
-    found = []
-
-    for device in _get_all_devices():
-        logger.debug('examining %s' % (device,))
-
-        mounted_paths = _get_property(device, 'DeviceMountPaths')
-        if path in mounted_paths:
-            found.append(device)
-
-        # device path
-        device_file = _get_property(device, 'DeviceFile')
-        if path == device_file:
-            found.append(device)
-
-    return found
-
-def handleable(device_path):
-    """Check if the device should be handled by udiskie.
-    
-    Right now this just means that the device is removable."""
-
-    removable = _get_property(device_path, 'DeviceIsRemovable')
-    logger = logging.getLogger('udiskie.util.handleable')
-    logger.debug('device_path: %s, removable: %s' % (device_path, removable))
-    return removable
-
-def mounted(device_path):
-    """Check if the device is currently mounted."""
-
-    return _get_property(device_path, 'DeviceIsMounted')
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.