eric6/PluginManager/PluginManager.py

changeset 7967
f5da85158db2
parent 7946
6901746220fc
child 8043
0acf98cd089a
child 8143
2c730d5fd177
equal deleted inserted replaced
7966:3afa7b9e51b0 7967:f5da85158db2
222 with open(fname, "w"): 222 with open(fname, "w"):
223 pass 223 pass
224 except OSError: 224 except OSError:
225 del self.pluginDirs["user"] 225 del self.pluginDirs["user"]
226 226
227 if (
228 not os.path.exists(self.pluginDirs["global"]) and
229 os.access(Utilities.getPythonModulesDirectory(), os.W_OK)
230 ):
231 # create the global plugins directory
232 os.mkdir(self.pluginDirs["global"], 0o755)
233 fname = os.path.join(self.pluginDirs["global"], "__init__.py")
234 with open(fname, "w", encoding="utf-8") as f:
235 f.write('# -*- coding: utf-8 -*-' + "\n")
236 f.write("\n")
237 f.write('"""' + "\n")
238 f.write('Package containing the global plugins.' + "\n")
239 f.write('"""' + "\n")
240 if not os.path.exists(self.pluginDirs["global"]): 227 if not os.path.exists(self.pluginDirs["global"]):
241 del self.pluginDirs["global"] 228 try:
229 # create the global plugins directory
230 os.mkdir(self.pluginDirs["global"], 0o755)
231 fname = os.path.join(self.pluginDirs["global"], "__init__.py")
232 with open(fname, "w", encoding="utf-8") as f:
233 f.write('# -*- coding: utf-8 -*-' + "\n")
234 f.write("\n")
235 f.write('"""' + "\n")
236 f.write('Package containing the global plugins.' + "\n")
237 f.write('"""' + "\n")
238 except OSError:
239 del self.pluginDirs["global"]
242 240
243 if not os.path.exists(self.pluginDirs["eric6"]): 241 if not os.path.exists(self.pluginDirs["eric6"]):
244 return ( 242 return (
245 False, 243 False,
246 self.tr( 244 self.tr(

eric ide

mercurial