Ejemplo n.º 1
0
 def __init__(self):
     Plugin.load()
     self.allowed_filetypes = []
     self.allowed_formats = []
     for p, p_class in Plugin.registered.items():
         print("Registered output plugin type %s" % p)
         self.allowed_filetypes.append(p_class.template_file_extension)
         self.allowed_formats.append(p.split('Resume')[0])
Ejemplo n.º 2
0
 def __init__ (self):
     Plugin.load()
     self.allowed_filetypes = []
     self.allowed_formats = []
     for p, p_class in Plugin.registered.items():
         print("Registered output plugin type %s" % p)
         self.allowed_filetypes.append(p_class.template_file_extension)
         self.allowed_formats.append(p.split('Resume')[0])
Ejemplo n.º 3
0
 def __init__(self):
     #Plugin.load("plugins/")
     script_dir = os.path.dirname(os.path.realpath(sys.argv[0]))
     Plugin.load(os.path.join(script_dir, "plugins"))
     self.allowed_filetypes = []
     self.allowed_formats = []
     for p, p_class in Plugin.registered.items():
         print("Registered output plugin type %s" % p)
         self.allowed_filetypes.append(p_class.template_file_extension)
         self.allowed_formats.append(p.split('Resume')[0])
Ejemplo n.º 4
0
 def __init__ (self):
     #Plugin.load("plugins/")
     script_dir = os.path.dirname(os.path.realpath(sys.argv[0]))
     Plugin.load(os.path.join(script_dir,"plugins"))
     self.allowed_filetypes = []
     self.allowed_formats = []
     for p, p_class in Plugin.registered.items():
         print("Registered output plugin type %s" % p)
         self.allowed_filetypes.append(p_class.template_file_extension)
         self.allowed_formats.append(p.split('Resume')[0])
 def loadPluginsFrom(self, newPath):
     self.selectTechniqueByName(None)
     self._techniques = {}
     if newPath:
         Plugin.load(newPath)
         for p in Plugin.getInstances():
             origName = p.name.strip()
             if not origName:
                 continue
             name = origName
             i = 1
             while self._techniques.has_key(name):
                 name = "%s %d" % (origName, i)
                 i += 1
             self._techniques[name] = p
    def loadPluginsFrom(self, newPath):
        # force the teardown of the current selected technique (if any)
        self.selectTechniqueByName(None)

        self._pluginsPath = newPath
        self._techniques = {}
        if newPath:
            Plugin.load(newPath)
            for p in Plugin.getInstances():
                origName = p.getName()
                # some sanity check
                origName = unicode(origName).strip() if origName is not None \
                    else None
                if not origName:
                    continue
                # append a discriminant id if the name is already being used
                name = origName
                i = 1
                while name in self._techniques:
                    name = "%s %d" % (origName, i)
                    i += 1
                self._techniques[name] = p
Ejemplo n.º 7
0
#!/usr/bin/env -S pipenv run python
import sys

import json
from logging import DEBUG, basicConfig
from pathlib import Path
from telegram import Bot, ParseMode
from telegram.utils.request import Request

from plugin import Plugin

my_plugin_id = 11252
plugins_ids = [7754, my_plugin_id]
plugins = {id: Plugin.load(id) for id in plugins_ids}

telegram_chat_id = 108562525
telegram_bot_token = Path(sys.path[0] + '/token.txt').read_text().strip()


def send_message(chat_id, msg, token):
    request = Request(proxy_url='socks5://phobos.public.opennetwork.cc:1090',
                      urllib3_proxy_kwargs={
                          'username': '******',
                          'password': '******'
                      })

    basicConfig(level=DEBUG,
                format='%(asctime)s - %(name)s - %(levelname)s\n%(message)s\n')

    Bot(token, request=request) \
        .sendMessage(chat_id, msg, parse_mode=ParseMode.MARKDOWN, disable_notification=True)
Ejemplo n.º 8
0
 def _register_plugins(self):
     script_dir = os.path.dirname(os.path.realpath(sys.argv[0]))
     Plugin.load(os.path.join(script_dir,"plugins"))
     for p, p_class in Plugin.registered.items():
         print("Registered output plugin type %s" % p)