Exemplo n.º 1
0
def log_extension_status():
    """
    After the fact logging of what extensions were loaded. Useful for R
    :return:
    """
    log_debug('Successful Extension Initialisation')
    for e in LoadedExtensions:
        log_debug(e)
    if len(DecoratedFailedExtensions) == 0:
        log_debug('No extension loads failed.')
        return
    log_warning('Failed Extension Initialisation')
    for f, warn in DecoratedFailedExtensions:
        log_warning('Extension_File\t{0}\tMessage:\t{1}'.format(f, warn))
Exemplo n.º 2
0
    def __init__(self, *args):
        super(BrowserController, self).__init__(*args)

        try:
            if values['BROWSERTYPE'] == "Internet Explorer":
                self.engine = webdriver.Ie()
                self.open_site()
            elif values['BROWSERTYPE'] == "Firefox":
                self.engine = webdriver.Firefox()
                self.open_site()
            elif values['BROWSERTYPE'] == "Chrome":
                self.engine = webdriver.Chrome()
                self.open_site()
        except (AttributeError, WebDriverException, NoSuchWindowException,
                TypeError) as browser_error:
            log_warning(
                "Issue Instantiating Browser: {}".format(browser_error))
            Psg.PopupError(browser_error)
Exemplo n.º 3
0
    file_handler.setLevel(LOGLEVEL)
    file_handler.setFormatter(Formatter(LOGFORMATTER))
    memory_handler.setTarget(file_handler)

def remove_log_file():
    """closes the log file and removes memory_handler from pointing at it"""
    if memory_handler.target:
        old_log_file_path=memory_handler.target.baseFilename
        memory_handler.target.flush()
        memory_handler.target.close()
        memory_handler.target=None
        return old_log_file_path

if __name__=="__main__":
    log_info("yoy")
    log_warning("yay")
    make_log_file("/Users/thomasaref/Documents/TA_software/ztestlog2.txt", mode='w')

    log_info(2)
    log_info(3)
    log_info(4)
    log_info(5)
    remove_log_file()
    #dir_path, divider, log_name=memory_handler.target.baseFilename.rpartition("/")
    #print dir_path, divider, log_name #memory_handler.target.baseFilename.split(log_name)
    log_info(6)
    make_log_file("/Users/thomasaref/Documents/TA_software/ztestlog2.txt")

    log_info(7)
    log_info(8)
    log_info(9)
Exemplo n.º 4
0
    memory_handler.setTarget(file_handler)


def remove_log_file():
    """closes the log file and removes memory_handler from pointing at it"""
    if memory_handler.target:
        old_log_file_path = memory_handler.target.baseFilename
        memory_handler.target.flush()
        memory_handler.target.close()
        memory_handler.target = None
        return old_log_file_path


if __name__ == "__main__":
    log_info("yoy")
    log_warning("yay")
    make_log_file("/Users/thomasaref/Documents/TA_software/ztestlog2.txt",
                  mode='w')

    log_info(2)
    log_info(3)
    log_info(4)
    log_info(5)
    remove_log_file()
    #dir_path, divider, log_name=memory_handler.target.baseFilename.rpartition("/")
    #print dir_path, divider, log_name #memory_handler.target.baseFilename.split(log_name)
    log_info(6)
    make_log_file("/Users/thomasaref/Documents/TA_software/ztestlog2.txt")

    log_info(7)
    log_info(8)
Exemplo n.º 5
0
        client_attr = {
            'version': self.client_version,
            'mode': 'GUI2',
        }
        try:
            server_attr = self.client.call("ufwi_ruleset", "setupClient", client_attr)
        except RpcdError, err:
            if err.type != 'CoreError':
                raise
            self.server_version = self.client.call("ufwi_ruleset", "getComponentVersion")
            self.mode = 'GUI'
        else:
            self.server_version = server_attr['version']
            self.mode = server_attr['mode']

        log_warning("Connected to server %s in mode %s" % (self.server_version, self.mode))

    def getFeatures(self):
        self.ipsec_network = True
        self.auth_quality = True
        self.default_decisions = True
        self.set_fusion_service = True
        self.nat_support_accept = True
        self.user_group_name = True
        self.has_move_rule = True
        self.platform = True

        if self.server_version == "3.0.5":
            self.platform = False

        elif self.server_version == "3.0.4":