Helpers

This module defines some helper code used internally by the browser_history package.

Module defines Platform class enumerates the popular Operating Systems.

class browser_history.utils.Platform(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

An enum used to indicate the system’s platform

A value of 0 is reserved for unknown platforms.

Usage: To be used without instantiating like so:

linux = Platform.LINUX
mac = Platform.MAC
windows = Platform.WINDOWS

See get_platform() to infer the platform from the system.

browser_history.utils.default_browser()

This method gets the default browser of the current platform

Returns:

A browser_history.generic.Browser object representing the default browser in the current platform. If platform is not supported or default browser is unknown or unsupported None is returned

Return type:

union[browser_history.generic.Browser, None]

browser_history.utils.get_browser(browser_name)

This method returns the browser class from a browser name.

Parameters:

browser_name – a string representing one of the browsers supported or default (to fetch the default browser).

Returns:

A browser class which is a subclass of browser_history.generic.Browser otherwise None if no supported browsers match the browser name given or the given browser is not supported on the current platform

Return type:

union[browser_history.generic.Browser, None]

browser_history.utils.get_browsers()

This method provides a list of all browsers implemented by browser_history.

Returns:

A list containing implemented browser classes all inheriting from the super class browser_history.generic.Browser

Return type:

list

browser_history.utils.get_platform()

Returns the current platform

Return type:

Platform

browser_history.utils.get_platform_name(plat=None)

Returns human readable name of the current platform

Return type:

str