예제 #1
0
 def __postCheck(self, quotes):
     return Base.checkPostsList(quotes, self.__class__.__name__)
예제 #2
0
import sys
import time
from os import listdir
from importlib import import_module

from bash_vk.vk import Vk
from bash_vk.log import Log
from bash_vk.base import Base
from bash_vk.config import Config
from bash_vk.config import BashReadError
from bash_vk.security import Security
from bash_vk.joke import Joke

### Load main classes ###
Config.init("./bash.ini")
Base.init("./bash.db")
Vk.init()
Security.init()

### DRATUTI ###
Log.log(Config.getCfg("MAIN", "program") + " v." + Config.getCfg("MAIN", "version"))
Log.log("=" * len(Config.getCfg("MAIN", "program") + " v." + Config.getCfg("MAIN", "version"))
)

### Dynamic load parsing classes from bash_vk\sites ###
classes = []
files = listdir(".\\bash_vk\\sites")
sites = filter(lambda x: x.endswith(".py"), files)
sites = filter(lambda x: x != "__init__.py", sites)
sites = filter(lambda x: x != "site_sample.py", sites)
sites = map(lambda x: x[:-3], sites)
예제 #3
0
    def getPosts(self):
        if not self.__preCheck(Base.getLastPost4Name(self.__class__.__name__)):
            return {}

        return self.__postCheck(self.__read())
예제 #4
0
    def getPosts(self):
        if not self.__preCheck(Base.getLastPost4Type(self.post_type)):
            return {}

        return self.__postCheck(self.__read())