Box 程序

setter.py 583B

    # -*- coding: utf-8 -*- import os import time def local_string(): return time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()) def set_time(timestr): # with open('/ramfs/current_time', 'w') as f: # f.write('date -s "{}"'.format(timestr)) dates = 'date -s "{}"'.format(timestr) os.system("echo '{}' > /ramfs/current_time_tmp; mv /ramfs/current_time_tmp /ramfs/current_time".format(dates)) def set_version(bpversion_str): os.system("echo '{}' > /ramfs/current_version_tmp; mv /ramfs/current_version_tmp /ramfs/current_version".format(bpversion_str))