Example #1
0
 def do_GET(self):
   #think I just need this below
   if '.json' in self.path:
     #handle json request here 
     handler = json_handler() 
     self.wfile.write( handler.handle_json(self.path) )
   else:
     fFileToServe = open('html/' + self.path[1:] ,'r') #urllib removed front / urllib 2 gives it thus starting at 1
     self.copyfile(fFileToServe, self.wfile)
     fFileToServe.close()
   return
Example #2
0
    def __init__( self ):
        conf = conf_handler.conf_handler(conf_name = __m_module_name + ".conf")
        if (conf == None):
            logger.log("Unable to load config file "+ __m_module_name + ".conf" )
            return
        
        notifications_path = conf.read_conf("notifications_path")
        if (notifications_path == None):
            logger.log("Unable to find notifications path in config." )
            return

        __m_notification_json = json_handler.json_handler(notifications_path)
        if ( __m_notification_json == None):
            logger.log("Unable to load json file " + __m_notification_json )
            return
Example #3
0
 def __init__( self, conf_base = "../conf/", conf_name = "configuration.conf" ):
         self.__m_conf_path = conf_base + conf_name
         self.__m_conf = json_handler.json_handler(self.__m_conf_path)