def init(self, path): """Called on filesystem mount. Path is always /.""" if gdrivefs.config.changes.MONITOR_CHANGES is True: _logger.info("Activating change-monitor.") get_change_manager().mount_init() else: _logger.warning("We were told not to monitor changes.")
def destroy(self, path): """Called on filesystem destruction. Path is always /.""" _logger.info("Destroying filesystem resource.") if gdrivefs.config.changes.MONITOR_CHANGES is True: _logger.info("Stopping change-monitor.") get_change_manager().mount_destroy() _logger.info("Destroyed filesystem resource.")
def test_get_changes(self): from gdrivefs.change import get_change_manager get_change_manager().process_updates() import sys sys.exit() (largest_change_id, next_page_token, changes) = drive_proxy('list_changes') print("Largest Change ID: [%s]" % (largest_change_id)) print("Next Page Token: [%s]" % (next_page_token)) from pprint import pprint pprint(len(changes)) print for change_id, (entry_id, was_deleted, entry) in changes.iteritems(): print("%d> [%s] D:[%s] [%s]" % (change_id, entry_id, was_deleted, entry.title if entry else '<deleted>'))
def destroy(self, path): """Called on filesystem destruction. Path is always /.""" get_change_manager().mount_destroy()
def init(self, path): """Called on filesystem mount. Path is always /.""" get_change_manager().mount_init()