561 |
561 |
562 @param destination name of the plugin directory (string) |
562 @param destination name of the plugin directory (string) |
563 @param pluginFileName name of the plugin file (string) |
563 @param pluginFileName name of the plugin file (string) |
564 @param packageName name of the plugin package (string) |
564 @param packageName name of the plugin package (string) |
565 """ |
565 """ |
566 if packageName in ("", "None"): |
566 packageDir = ( |
567 packageDir = None |
567 None |
568 else: |
568 if packageName in ("", "None") else |
569 packageDir = os.path.join(destination, packageName) |
569 os.path.join(destination, packageName) |
|
570 ) |
570 pluginFile = os.path.join(destination, pluginFileName) |
571 pluginFile = os.path.join(destination, pluginFileName) |
571 |
572 |
572 with contextlib.suppress(OSError, os.error): |
573 with contextlib.suppress(OSError, os.error): |
573 if packageDir and os.path.exists(packageDir): |
574 if packageDir and os.path.exists(packageDir): |
574 shutil.rmtree(packageDir) |
575 shutil.rmtree(packageDir) |