Bläddra i källkod

上傳檔案到 ''

rita 2 år sedan
förälder
incheckning
b705c7de5f
1 ändrade filer med 20 tillägg och 20 borttagningar
  1. 20 20
      manage.py

+ 20 - 20
manage.py

@@ -408,32 +408,32 @@ def add_server_views():
     if request.method == 'GET':
         # ============================================================================================
         # # 232 路徑
-        # Users = os.popen("getent passwd 1000 | cut -d: -f1")
-        # UserFile = Users.read().strip()
-        # print("UserFile:", UserFile)
+        Users = os.popen("getent passwd 1000 | cut -d: -f1")
+        UserFile = Users.read().strip()
+        print("UserFile:", UserFile)
 
-        # os.system('git clone -b sh --single-branch http://60.250.156.230:3000/Automatic_build_system/Automatically_install_files.git /home/' + UserFile + '/BBend-Test-JWT/newSH')
-        # with open('/home/' + UserFile + '/BBend-Test-JWT/newSH/coffeesystem.sh', encoding='utf-8') as f:
-        #     D['command'] = f.read().split('\n')
-        # sl(3)
-        # shutil.rmtree('/home/' + UserFile + '/BBend-Test-JWT/newSH', onerror=remove_readonly)
-        # with open('/home/' + UserFile + '/BBend-Test-JWT/Item.txt') as f:
-        #     D['item_name'] = f.read().split('\n')
-        #     for item in D['item_name']:
-        #         L.append('.'.join(item.split('.')[1:]))         # 拿掉 '.'.join 的話會變成 [['python3', '8'], ['python3-pip'],
-    
-        # ============================================================================================
-        # # # 本機 路徑
-        os.system('git clone -b sh --single-branch http://60.250.156.230:3000/Automatic_build_system/Automatically_install_files.git C:/Users/USER/Rita/operating/sixthproject/BBend-Test-JWT/newSH')
-        with open('C:/Users/USER/Rita/operating/sixthproject/BBend-Test-JWT/newSH/coffeesystem.sh', encoding='utf-8') as f:
+        os.system('git clone -b sh --single-branch http://60.250.156.230:3000/Automatic_build_system/Automatically_install_files.git /home/' + UserFile + '/BBend-Test-JWT/newSH')
+        with open('/home/' + UserFile + '/BBend-Test-JWT/newSH/coffeesystem.sh', encoding='utf-8') as f:
             D['command'] = f.read().split('\n')
-        # print("D['command']: ", D['command'])
         sl(3)
-        shutil.rmtree('newSH', onerror=remove_readonly)
-        with open('Item.txt') as f:
+        shutil.rmtree('/home/' + UserFile + '/BBend-Test-JWT/newSH', onerror=remove_readonly)
+        with open('/home/' + UserFile + '/BBend-Test-JWT/Item.txt') as f:
             D['item_name'] = f.read().split('\n')
             for item in D['item_name']:
                 L.append('.'.join(item.split('.')[1:]))         # 拿掉 '.'.join 的話會變成 [['python3', '8'], ['python3-pip'],
+    
+        # ============================================================================================
+        # # # 本機 路徑
+        # os.system('git clone -b sh --single-branch http://60.250.156.230:3000/Automatic_build_system/Automatically_install_files.git C:/Users/USER/Rita/operating/sixthproject/BBend-Test-JWT/newSH')
+        # with open('C:/Users/USER/Rita/operating/sixthproject/BBend-Test-JWT/newSH/coffeesystem.sh', encoding='utf-8') as f:
+        #     D['command'] = f.read().split('\n')
+        # # print("D['command']: ", D['command'])
+        # sl(3)
+        # shutil.rmtree('newSH', onerror=remove_readonly)
+        # with open('Item.txt') as f:
+        #     D['item_name'] = f.read().split('\n')
+        #     for item in D['item_name']:
+        #         L.append('.'.join(item.split('.')[1:]))         # 拿掉 '.'.join 的話會變成 [['python3', '8'], ['python3-pip'],
         # # ============================================================================================
 
         sl(3)