def __init__(self): app_name = 'dbhandler_test' logfile = 'system' log_level = 10 screendump = True # log.info('Starting DentrixReporting logger...', # app_name = app_name, # logfile = logfile, # log_level = log_level, # screendump = screendump # ) self.config = ConfigHandler( self, app_name=app_name, logfile=logfile, log_level=log_level, screendump=screendump, config_file= "/Users/mikes/Documents/Eclipseworkspace/Telemend/Telemend-Dentrix-Reporting/conf/DentrixReporting.conf" ) DBO = DBHandler.handler('mssql') print 'DBO = ', DBO
def __init__(self, *args, **kwargs): self.config = ConfigHandler() self.args = args self.kwargs = kwargs self.default = DBHandler_defaults() self._check_host() self._check_db_name() self._check_db_port() # Sets database parameters from dbvars.cfg # self._set_db_vars() # # # Check for overriding vars passed into __init__ # if host is not None: self.dbvars['host'] = str(host) # if database is not None: self.dbvars['database'] = str(database) # if port is not None: self.dbvars['port'] = str(port) # if user is not None: self.dbvars['user'] = str(user) # if password is not None: self.dbvars['password'] = str(password) # # # Actually create the DB connection and cursor # self._set_db() # # self.values = {} log.debug("DBHandler set successfully.")
def __init__(self, base_dir, lib_name): self.app = None self.lib_name = lib_name self.base_dir = base_dir self.static_handler = StaticHandler(self.base_dir) self.template_handler = TemplateHandler() self.force_overwrite = False self.config = ConfigHandler(self.get_conf_path())
def __init__(self): logging.info('Creating RESTHandler'); self.lock = threading.RLock() self.since_id = None # Get Config and set since_id self.config = ConfigHandler() self.since_id = self.config.mention_id() # Attempt to get OAuth Client self.oauthhandler = OAuthHandler(self.config) if(self.verify_credentials()): logging.info('OAuth Client created successfully') else: logging.critical('Unable to birth OAuth Client')
def __init__(self): self.cfg = ConfigHandler('thm.cfg') self.cfg.readConfig() self.groups = [] self.floor = None self.space = pymunk.Space() self.space.gravity = (0.0, 0.0) self.space.damping = 0.0 #self.space.set_default_collision_handler() self.space.add_collision_handler(1, 2, callSpeshulEffect) self.space.add_collision_handler(2, 2, callSpeshulEffect) self.speshulCaller = callSpeshulEffect self.postStepQueue = [] self.gameLogicManager = ActualManager(self) self.justEditing = False self.spaceGhost = None #If this is true, devtools will class update EVERYTHING. self.forceUpdateEverything = False self.boundaryBody = pymunk.Body() self.boundaries = [] #A list of int values that represent the index values of a #group in self.groups, each group is drawn in order of the # values in this list. Use addGroup() to add one, by default # it puts the group in the last index of self.drawOrder, # unless passed a index value. self.drawOrder = [] self.interweaveOrder = {} self.curInputDict = {} self.playersGroup = None self.namedGroups = {'playersGroup': self.playersGroup} self.lineVisualiser = LineVisualiser(self) self.rerenderEverything = False self.soundManager = SoundManager(self) self.hudList = [] self.fileName = "Untitled" self.amountOfEntsOnLoad = None self.hardBlockInput = False self.inputDictLog = [] #These to variables are the displacement from the state's (0,0) and the screen's (0,0), so they can be used for panning. self.panX, self.panY = 0, 0 self.limitX1, self.limitX2, self.limitY1, self.limitY2 = None, None, None, None #This is the idSource, I use it for give ids to Entitys. self.idSource = IdSource() self.isClient = False self.isHost = False self.networkRate = 20.0 self.networkTicker = 0 self.networkNode = None self.networkingStarted = False #This is set by the DevMenu init self.devMenuRef = None self.paused = False self.keyboardInputEnabled = False self.deleteLastChar = False self.checkFocus = False self.pausedByFocus = False #So this is quite an important boolean. #If this is true everything in the PlayState will be drawn in order of the bottom of it's bounding rect, which I will refer #to as 'the foot'. If the foot is higher up the screen, the item will be drawn sooner. #If this is False, everything will be drawn according to the drawOrder and interweaveOrder system. #DrawByFeet is more suitable for some topdown/isometric games. self.drawByFeet = False self.useSuggestedGravityEntityPhysics = False self.stateToSwap = None
def config(self): return ConfigHandler(self.beets)
import os from confighandler import ConfigHandler if os.path.exists('settings.json') and os.path.exists('settings_default.json'): CONFIG = ConfigHandler('settings.json', os.environ, 'settings_default.json') else: CONFIG = ConfigHandler(os.environ)
#Apparently all the scripts ran by extention of this have this in their paths, huh. sys.path.extend( ["modules/stockfunctions", "modules/stockclasses", "extern_modules"]) from entity import EntityGroup from floor import Floor from devtools import DevMenu from state import PlayState from confighandler import ConfigHandler cfg = ConfigHandler('thm.cfg') cfg.readConfig() #from modules import * timer = pygame.time.Clock() if int(cfg.getVal('fullscreen')) == 1: screen = pygame.display.set_mode((cfg.getWidth(), cfg.getHeight()), pygame.FULLSCREEN) else: screen = pygame.display.set_mode((cfg.getWidth(), cfg.getHeight())) cheatScreen = pygame.Surface((800, 600)).convert() #pygame.event.set_allowed([QUIT, KEYDOWN, KEYUP])