예제 #1
0
파일: install.py 프로젝트: dowem/clai
def register_the_user(bin_path, system):
    users = read_users(bin_path)
    user_path = os.path.expanduser(get_rc_file(system))
    if user_path not in users:
        users.append(user_path)

    with open(bin_path + '/usersInstalled.json', 'w') as json_file:
        json.dump(users, json_file)
예제 #2
0
파일: uninstall.py 프로젝트: xzlin/clai
def unregister_the_user(bin_path):
    users = read_users(bin_path)
    user_path = os.path.expanduser(get_rc_file())
    if user_path in users:
        users.remove(user_path)

    with open(bin_path + "/usersInstalled.json", "w") as json_file:
        json.dump(users, json_file)

    return users
예제 #3
0
파일: install.py 프로젝트: dowem/clai
def create_rc_file_if_not_exist(system):
    rc_file_path = os.path.expanduser(get_rc_file(system))
    if not os.path.isfile(rc_file_path):
        open(rc_file_path, 'a').close()