Ejemplo n.º 1
0
 def get_fix_commands(self):
     return (
         (self.exe('phpcbf'), '--standard=' + self.cfg('phpcs'),
          '--encoding=' + parser.get('phpcs', 'encoding', 'utf-8'),
          '--runtime-set', 'ignore_warnings_on_exit', 'true',
          ),
     )
Ejemplo n.º 2
0
from telethon.sync import TelegramClient
from telethon.sessions import StringSession
from settings import parser, configwrite

API_KEY = parser.getint("API", "API_KEY")
API_HASH = parser.get("API", "API_HASH")

if parser.get("API", "SESSION_ID") == "":
    with TelegramClient(StringSession(), API_KEY, API_HASH) as client:
        parser.set("API", "SESSION_ID", client.session.save())
        configwrite()
else:
    print(
        """A session is already active, please clear SESSION_ID value on bot.config file\nand remove meowbot.session file."""
    )
    exit(1)
Ejemplo n.º 3
0
# coding:utf-8
"""
Created on 15.10.13

@author: kasimova
"""
__version__ = "1.0.0"
import os
from django.conf import settings as settings_pr

from settings import parser
from helpers import import_class
from manager import PluginManager

PlManager = PluginManager()
PlManager.locator = import_class(parser.get("DEFAULT", "PLUGIN_LOCATOR"))()
PlManager.validator = import_class(parser.get("DEFAULT", "PLUGIN_VALIDATOR"))()
PlManager.storage = import_class(parser.get("DEFAULT", "PLUGIN_STORAGE"))()
PlManager.installer = import_class(parser.get("DEFAULT", "PLUGIN_INSTALLER"))()
PlManager.installer.install_dir = parser.get("DEFAULT", "PATH_TO_INSTALL")

plugins = map(lambda x: "%s.%s" % (os.path.basename(PlManager.installer.install_dir), x), PlManager.get_plugins())

settings_pr.INSTALLED_APPS += tuple(plugins)
Ejemplo n.º 4
0
from settings import parser
from telethon import TelegramClient
from telethon.sessions import StringSession


# Conversion functions
def str2bool(s):
    return s.lower() in ["true"]


# Global variables
API_KEY = parser.getint("API", "api_key")
API_HASH = parser.get("API", "api_hash")
SESSION = parser.get("API", "session_id")

VERBOSE = str2bool(parser.get("DEBUG", "verbose"))

cat = TelegramClient(StringSession(SESSION), API_KEY, API_HASH)

with open("modules.order") as f:
    MODULES = [line.rstrip() for line in f]