Example #1
0
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)
Example #2
0
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
Example #3
0
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()