def cleanup(messages): print "running cleanup" print messages for message in messages: try: if message['action']=='unmount': ramdisk = RamDisk(path=message['path'], device=message['device']) ramdisk.unmount() elif message['action']=='kill': message['process'].terminate() except Exception as e: print e
def load_ramdisk(): try: ramdisk = RamDisk(name, source_image=data_path('resources/mac_disk_image_compressed.dmg')) ramdisk.mount() GlobalState.cleanup_message.send({'action': 'unmount', 'path': ramdisk.path, 'device': ramdisk.device}) if sys.platform == 'darwin': platform_tools.run_applescript(file=data_path('resources/display disk image.scpt')) crypto.set_access_control_for_import_folder(ramdisk.path) ramdisk.watch() GlobalState.ramdisk = ramdisk wx.CallAfter(pub.sendMessage, 'ramdisk.loaded') except NotImplementedError: wx.CallAfter(pub.sendMessage, 'ramdisk.failed')
def load_ramdisk(): try: ramdisk = RamDisk(name, source_image=data_path( 'resources/mac_disk_image_compressed.dmg')) ramdisk.mount() GlobalState.cleanup_message.send({ 'action': 'unmount', 'path': ramdisk.path, 'device': ramdisk.device }) if sys.platform == 'darwin': platform_tools.run_applescript( file=data_path('resources/display disk image.scpt')) crypto.set_access_control_for_import_folder(ramdisk.path) ramdisk.watch() GlobalState.ramdisk = ramdisk wx.CallAfter(pub.sendMessage, 'ramdisk.loaded') except NotImplementedError: wx.CallAfter(pub.sendMessage, 'ramdisk.failed')