
import os
import pkgutil
import sys


def load_venue_plugins():
    """
    Read plugin directory and load found plugins.
    Variable "blacklisted" can be used to exclude loading certain plugins.
    """
    blacklisted = ["plugin_tiketti", "plugin_ontherocks"]
    foundblacklisted = list()
    loadedplugins = list()
    pluginspathabs = os.path.join(os.path.dirname(__file__), "venues")

    for loader, plugname, ispkg in \
            pkgutil.iter_modules(path = [pluginspathabs]):
        if plugname in sys.modules:
            continue
        if plugname in blacklisted:
            foundblacklisted.append(plugname.lstrip("plugin_"))
            continue

        plugpath = "venues.%s" % (plugname)
        loadplug = __import__(plugpath, fromlist = [plugname])

        classname = plugname.split("_")[1].title()
        loadedclass = getattr(loadplug, classname)

        instance = loadedclass()
        loadedplugins.append(instance)
        print(f"Loaded plugin: {instance.getVenueName()}")
    print("Blacklisted plugins: {}.\n".format(", ".join(foundblacklisted[1:])))
    return  loadedplugins

if __name__ == '__main__':
    load_venue_plugins()


import os
import pkgutil
import sys


def load_venue_plugins():
    """
    Read plugin directory and load found plugins.
    Variable "blacklisted" can be used to exclude loading certain plugins.
    """
    blacklisted = ["plugin_tiketti"]
    foundblacklisted = list()
    loadedplugins = list()
    pluginspathabs = os.path.join(os.path.dirname(__file__), "venues")

    for loader, plugname, ispkg in \
            pkgutil.iter_modules(path = [pluginspathabs]):
        if plugname in sys.modules:
            continue
        if plugname in blacklisted:
            foundblacklisted.append(plugname.lstrip("plugin_"))
            continue

        plugpath = "venues.%s" % (plugname)
        loadplug = __import__(plugpath, fromlist = [plugname])

        classname = plugname.split("_")[1].title()
        loadedclass = getattr(loadplug, classname)

        instance = loadedclass()
        loadedplugins.append(instance)
        print(f"Loaded plugin: {instance.getVenueName()}")
    print("Blacklisted plugins: {}.\n".format(", ".join(foundblacklisted[1:])))
    return  loadedplugins

if __name__ == '__main__':
    load_venue_plugins()

Enable On the rocks plugin
Enable On the rocks plugin

  
  import os
  import pkgutil
  import sys
  
  
  def load_venue_plugins():
      """
      Read plugin directory and load found plugins.
      Variable "blacklisted" can be used to exclude loading certain plugins.
      """
-     blacklisted = ["plugin_tiketti", "plugin_ontherocks"]
+     blacklisted = ["plugin_tiketti"]
      foundblacklisted = list()
      loadedplugins = list()
      pluginspathabs = os.path.join(os.path.dirname(__file__), "venues")
  
      for loader, plugname, ispkg in \
              pkgutil.iter_modules(path = [pluginspathabs]):
          if plugname in sys.modules:
              continue
          if plugname in blacklisted:
              foundblacklisted.append(plugname.lstrip("plugin_"))
              continue
  
          plugpath = "venues.%s" % (plugname)
          loadplug = __import__(plugpath, fromlist = [plugname])
  
          classname = plugname.split("_")[1].title()
          loadedclass = getattr(loadplug, classname)
  
          instance = loadedclass()
          loadedplugins.append(instance)
          print(f"Loaded plugin: {instance.getVenueName()}")
      print("Blacklisted plugins: {}.\n".format(", ".join(foundblacklisted[1:])))
      return  loadedplugins
  
  if __name__ == '__main__':
      load_venue_plugins()
  
Enable On the rocks plugin
## Code Before:

import os
import pkgutil
import sys


def load_venue_plugins():
    """
    Read plugin directory and load found plugins.
    Variable "blacklisted" can be used to exclude loading certain plugins.
    """
    blacklisted = ["plugin_tiketti", "plugin_ontherocks"]
    foundblacklisted = list()
    loadedplugins = list()
    pluginspathabs = os.path.join(os.path.dirname(__file__), "venues")

    for loader, plugname, ispkg in \
            pkgutil.iter_modules(path = [pluginspathabs]):
        if plugname in sys.modules:
            continue
        if plugname in blacklisted:
            foundblacklisted.append(plugname.lstrip("plugin_"))
            continue

        plugpath = "venues.%s" % (plugname)
        loadplug = __import__(plugpath, fromlist = [plugname])

        classname = plugname.split("_")[1].title()
        loadedclass = getattr(loadplug, classname)

        instance = loadedclass()
        loadedplugins.append(instance)
        print(f"Loaded plugin: {instance.getVenueName()}")
    print("Blacklisted plugins: {}.\n".format(", ".join(foundblacklisted[1:])))
    return  loadedplugins

if __name__ == '__main__':
    load_venue_plugins()

## Instruction:
Enable On the rocks plugin
## Code After:

import os
import pkgutil
import sys


def load_venue_plugins():
    """
    Read plugin directory and load found plugins.
    Variable "blacklisted" can be used to exclude loading certain plugins.
    """
    blacklisted = ["plugin_tiketti"]
    foundblacklisted = list()
    loadedplugins = list()
    pluginspathabs = os.path.join(os.path.dirname(__file__), "venues")

    for loader, plugname, ispkg in \
            pkgutil.iter_modules(path = [pluginspathabs]):
        if plugname in sys.modules:
            continue
        if plugname in blacklisted:
            foundblacklisted.append(plugname.lstrip("plugin_"))
            continue

        plugpath = "venues.%s" % (plugname)
        loadplug = __import__(plugpath, fromlist = [plugname])

        classname = plugname.split("_")[1].title()
        loadedclass = getattr(loadplug, classname)

        instance = loadedclass()
        loadedplugins.append(instance)
        print(f"Loaded plugin: {instance.getVenueName()}")
    print("Blacklisted plugins: {}.\n".format(", ".join(foundblacklisted[1:])))
    return  loadedplugins

if __name__ == '__main__':
    load_venue_plugins()
