Esempio n. 1
0
 def onEnable(self):
     pluginlokacija1 = os.path.realpath("%s/plugins"%os.getcwd())
     if os.path.isfile("%s/Jobs/config.yml"%pluginlokacija1):
        self.findFolder()
        self.cfg = YamlConfiguration.loadConfiguration(File(os.path.join(self.folder,"config.yml")))
     else:
         os.mkdir("%s/Jobs/"%pluginlokacija1)
         self.findFolder()
         self.cfg = YamlConfiguration.loadConfiguration(File(os.path.join(self.folder,"config.yml")))
Esempio n. 2
0
 def onEnable(self):
     pluginlokacija1 = os.path.realpath("%s/plugins" % os.getcwd())
     if os.path.isfile("%s/Jobs/config.yml" % pluginlokacija1):
         self.findFolder()
         self.cfg = YamlConfiguration.loadConfiguration(
             File(os.path.join(self.folder, "config.yml")))
     else:
         os.mkdir("%s/Jobs/" % pluginlokacija1)
         self.findFolder()
         self.cfg = YamlConfiguration.loadConfiguration(
             File(os.path.join(self.folder, "config.yml")))
 def onEnable(self):
     self.findFolder()
     dynmap = server.getPluginManager().getPlugin("dynmap")
     if dynmap is not None and dynmap.isEnabled():
         self.api = dynmap.getMarkerAPI()
         Landmarks.markerset = self.api.getMarkerSet("pylandmarks") or self.api.createMarkerSet("pylandmarks","Landmarks",None,True)
         self.registerIcons()
         if not Landmarks.icons:
             severe("No icons found")
             Landmarks.disabled = True
         self.cfg = YamlConfiguration.loadConfiguration(File(os.path.join(self.folder,"config.yml")))
         Landmarks.default_type = self.cfg.getString("defaults.icon")
         if Landmarks.icons and Landmarks.default_type not in Landmarks.icons:
             Landmarks.default_type = Landmarks.icons.keys()[0]
             severe("Nonexistent icon set as default in config, using '%s' instead"%Landmarks.default_type)
         info("v%s enabled"%__plugin_version__)
     else:
         severe("Could not connect to dynmap")
         Landmarks.disabled = True
     return