933 # step 2: delete old entries |
933 # step 2: delete old entries |
934 hiddenPlugins = Preferences.getPluginManager("HiddenPlugins") |
934 hiddenPlugins = Preferences.getPluginManager("HiddenPlugins") |
935 for pluginName in downloads: |
935 for pluginName in downloads: |
936 downloads[pluginName].sort(key=lambda x: x[1]) |
936 downloads[pluginName].sort(key=lambda x: x[1]) |
937 |
937 |
938 if ( |
938 removeFiles = ( |
939 pluginName in hiddenPlugins and |
939 [f[0] for f in downloads[pluginName]] |
940 not Preferences.getPluginManager("KeepHidden") |
940 if (pluginName in hiddenPlugins and |
941 ): |
941 not Preferences.getPluginManager("KeepHidden")) else |
942 removeFiles = [f[0] for f in downloads[pluginName]] |
942 [f[0] for f in downloads[pluginName][ |
943 else: |
|
944 removeFiles = [f[0] for f in downloads[pluginName][ |
|
945 :-Preferences.getPluginManager("KeepGenerations")]] |
943 :-Preferences.getPluginManager("KeepGenerations")]] |
|
944 ) |
946 for removeFile in removeFiles: |
945 for removeFile in removeFiles: |
947 try: |
946 try: |
948 os.remove(os.path.join(downloadPath, removeFile)) |
947 os.remove(os.path.join(downloadPath, removeFile)) |
949 except OSError as err: |
948 except OSError as err: |
950 if not quiet: |
949 if not quiet: |