# Path: lib/config.py
# def load():
# def update(conf):
# def load_rule():
# def update_rule(rule):
# def rule_read(name, get_file_handle=None):
# def rule_write(name, rule):
# 
# Path: lib/out.py
# def windows_out(color, msg):
# def good(msg):
# def warning(msg):
# def error(msg):
# def jump(url):
# def alert(content, url):
#     STD_OUTPUT_HANDLE = -11


import requests
from lib import config
from lib import out

﻿#!/usr/bin/env python 
# coding: utf-8



'''
Checking update when it start
'''


def check_update():
    out.good("Checking update...")
    try:
        res = requests.get(config.load()['check_url'], timeout=10)
        version = res.content
        if version != config.load()['version']:
            update()
            return True
        else:
            return False
    except:
        out.error("Can not connect to update server!")
        return False


def update():

# Path: lib/config.py
# def load():
# def update(conf):
# def load_rule():
# def update_rule(rule):
# def rule_read(name, get_file_handle=None):
# def rule_write(name, rule):
# 
# Path: lib/out.py
# def windows_out(color, msg):
# def good(msg):
# def warning(msg):
# def error(msg):
# def jump(url):
# def alert(content, url):
#     STD_OUTPUT_HANDLE = -11


# Path: lib/update.py
import requests
from lib import config
from lib import out

﻿#!/usr/bin/env python 
# coding: utf-8



'''
Checking update when it start
'''


def check_update():
    out.good("Checking update...")
    try:
        res = requests.get(config.load()['check_url'], timeout=10)
        version = res.content
        if version != config.load()['version']:
            update()
            return True
        else:
            return False
    except:
        out.error("Can not connect to update server!")
        return False


def update():

    out.warning("New version is ok!")
