소스 검색

개행 좀 넣음

Surplus_Up (2DU) 7 년 전
부모
커밋
e7063d7bd4
4개의 변경된 파일24개의 추가작업 그리고 16개의 파일을 삭제
  1. 3 0
      app.py
  2. 16 15
      route/server_now_update.py
  3. 1 0
      route/server_restart.py
  4. 4 1
      route/tool/func.py

+ 3 - 0
app.py

@@ -217,6 +217,7 @@ try:
 
             curs.execute('insert into other (name, data) values ("robot", "User-agent: *\nDisallow: /\nAllow: /$\nAllow: /w/")')
         
+        print('----')
         print('Engine made robots.txt')
 except:
     pass
@@ -240,6 +241,7 @@ curs.execute('delete from other where name = "ver"')
 curs.execute('insert into other (name, data) values ("ver", ?)', [c_ver])
 
 def back_up():
+    print('----')
     try:
         shutil.copyfile(db_name + '.db', 'back_' + db_name + '.db')
         
@@ -257,6 +259,7 @@ try:
 except:
     back_time = 0
     
+print('----')
 if back_time != 0:
     print('Back up state : ' + str(back_time) + ' hours')
     

+ 16 - 15
route/server_now_update.py

@@ -16,9 +16,10 @@ def server_now_update_2(conn):
         else:
             up_data = 'stable'
 
-        if platform.system() == 'Linux':
-            print('Update')
+        print('----')
+        print('Update')
 
+        if platform.system() == 'Linux':
             ok = []
 
             ok += [os.system('git remote rm origin')]
@@ -27,19 +28,19 @@ def server_now_update_2(conn):
             ok += [os.system('git reset --hard origin/' + up_data)]
             if (ok[0] and ok[1] and ok[2] and ok[3]) == 0:
                 return redirect('/restart')
-        else:
-            if platform.system() == 'Windows':
-                print('Update')
-
-                urllib.request.urlretrieve('https://github.com/2DU/opennamu/archive/' + up_data + '.zip', 'update.zip')
-                zipfile.ZipFile('update.zip').extractall('')
-                ok = os.system('xcopy /y /r opennamu-' + up_data + ' .')
-                if ok == 0:
-                    print('Remove')
-                    os.system('rd /s /q opennamu-' + up_data)
-                    os.system('del update.zip')
-
-                    return redirect('/restart')
+            else:
+                print('Update error')
+        elif platform.system() == 'Windows':
+            urllib.request.urlretrieve('https://github.com/2DU/opennamu/archive/' + up_data + '.zip', 'update.zip')
+            zipfile.ZipFile('update.zip').extractall('')
+            ok = os.system('xcopy /y /r opennamu-' + up_data + ' .')
+            if ok == 0:
+                os.system('rd /s /q opennamu-' + up_data)
+                os.system('del update.zip')
+
+                return redirect('/restart')
+            else:
+                print('Update error')
 
         return easy_minify(flask.render_template(skin_check(), 
             imp = [load_lang('update'), wiki_set(), custom(), other2([0, 0])],

+ 1 - 0
route/server_restart.py

@@ -9,6 +9,7 @@ def server_restart_2(conn):
     if flask.request.method == 'POST':
         admin_check(None, 'restart')
 
+        print('----')
         print('Restart')
 
         os.execl(sys.executable, sys.executable, *sys.argv)

+ 4 - 1
route/tool/func.py

@@ -53,9 +53,11 @@ for i in range(0, 2):
                 else:
                     raise
             else:
+                print('----')
                 print(e)
                 raise
         else:
+            print('----')
             print(e)
             raise
 
@@ -93,7 +95,8 @@ def send_email(who, title, data):
 
         smtp.quit()
     except:
-        print('Error : Email login error')
+        print('----')
+        print('Error : Email send error')
 
 def last_change(data):
     json_address = re.sub("(((?!\.|\/).)+)\.html$", "set.json", skin_check())