except Exception as Ex:
    log.error("Error determining OS version in metrics.py")

# Build user-agent
user_agent = "Mozilla/5.0 (%s) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36" % os_version

params = {
    "cid": s.get("unique_install_id"),  # Unique install ID
    "v": 1,  # Google Measurement API version
    "tid": "UA-4381101-5",  # Google Analytic Tracking ID
    "an": info.PRODUCT_NAME,  # App Name
    "aip": 1,  # Anonymize IP
    "aid": "org.openshot.%s" % info.NAME,  # App ID
    "av": info.VERSION,  # App Version
    "ul": language.get_current_locale().replace('_',
                                                '-').lower(),  # Current Locale
    "ua": user_agent,  # Custom User Agent (for OS, Processor, and OS version)
    "cd1": libopenshot_version.ToString(),  # Dimension 1: libopenshot version
    "cd2":
    platform.python_version(),  # Dimension 2: python version (i.e. 3.4.3)
    "cd3": QT_VERSION_STR,  # Dimension 3: qt5 version (i.e. 5.2.1)
    "cd4": PYQT_VERSION_STR,  # Dimension 4: pyqt5 version (i.e. 5.2.1)
    "cd5": linux_distro
}


def track_metric_screen(screen_name):
    """Track a GUI screen being shown"""
    metric_params = deepcopy(params)
    metric_params["t"] = "screenview"
    metric_params["cd"] = screen_name
示例#2
0
except Exception as Ex:
    log.error("Error determining OS version in metrics.py")

# Build user-agent
user_agent = "Mozilla/5.0 (%s) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36" % os_version

params = {
    "cid" : s.get("unique_install_id"),     # Unique install ID
    "v" : 1,                                # Google Measurement API version
    "tid" : "UA-4381101-5",                 # Google Analytic Tracking ID
    "an" : info.PRODUCT_NAME,               # App Name
    "aip" : 1,                              # Anonymize IP
    "aid" : "org.openshot.%s" % info.NAME,  # App ID
    "av" : info.VERSION,                    # App Version
    "ul" : language.get_current_locale().replace('_','-').lower(),   # Current Locale
    "ua" : user_agent,                      # Custom User Agent (for OS, Processor, and OS version)
    "cd1" : libopenshot_version.ToString(), # Dimension 1: libopenshot version
    "cd2" : platform.python_version(),      # Dimension 2: python version (i.e. 3.4.3)
    "cd3" : QT_VERSION_STR,                 # Dimension 3: qt5 version (i.e. 5.2.1)
    "cd4" : PYQT_VERSION_STR,               # Dimension 4: pyqt5 version (i.e. 5.2.1)
    "cd5" : linux_distro
}

def track_metric_screen(screen_name):
    """Track a GUI screen being shown"""
    metric_params = deepcopy(params)
    metric_params["t"] = "screenview"
    metric_params["cd"] = screen_name
    metric_params["cid"] = s.get("unique_install_id")