From b6853563467d6a06df48726c2428a3130a256ff3 Mon Sep 17 00:00:00 2001 From: SummerGift Date: Tue, 27 Aug 2019 14:47:16 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=9B=B4=E6=96=B0=E3=80=91=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=20env=20=E5=BC=80=E6=9C=BA=E8=87=AA=E5=8A=A8=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- init_env.py | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 init_env.py diff --git a/init_env.py b/init_env.py new file mode 100644 index 00000000..d27f52e8 --- /dev/null +++ b/init_env.py @@ -0,0 +1,41 @@ +# -*- coding:utf-8 -*- +# +# File : env.py +# This file is part of RT-Thread RTOS +# COPYRIGHT (C) 2006 - 2019, RT-Thread Development Team +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Change Logs: +# Date Author Notes +# 2019-8-26 SummerGift first version +# + +from multiprocessing import Process +import os +import time + +def run_proc(name): + exec_file = os.path.join(os.getcwd(), "tools\scripts\env.py") + try: + os.system("python %s package --upgrade 1>std_null 2>err_null"%exec_file) + except Exception, e: + print("Auto upgrade failed, please check your network.") + pass + +if __name__=='__main__': + p = Process(target=run_proc, args=('upgrade',) ) + p.start() + p.join()