Просмотр исходного кода

Merge pull request #375 from 2DU/master

v2.6.4
ect (or 2du) 8 лет назад
Родитель
Сommit
1c775eb469
9 измененных файлов с 73 добавлено и 76 удалено
  1. 15 15
      app.py
  2. 2 2
      func.py
  3. 3 3
      mark.py
  4. 6 27
      readme.md
  5. 21 0
      readme.txt
  6. 10 16
      set_mark/footnote.py
  7. 4 2
      set_mark/link.py
  8. 6 10
      version.md
  9. 6 1
      views/acme/css/style-responsive.css

+ 15 - 15
app.py

@@ -17,8 +17,8 @@ logging.basicConfig(level = logging.ERROR)
 app = Flask(__name__)
 Reggie(app)
 
-r_ver = 'v2.6.3'
-print('버전 : ' + r_ver)
+r_ver = 'v2.6.4'
+print('Version : ' + r_ver)
 
 from func import *
 from set_mark.mid_pas import mid_pas
@@ -30,7 +30,7 @@ try:
     set_data = json.loads(json_data)
 except:
     while 1:
-        print('DB 이름 : ', end = '')
+        print('DB Name : ', end = '')
         new_json = str(input())
 
         if new_json != '':
@@ -42,7 +42,7 @@ except:
 
             break
         else:
-            print('값을 입력하세요.')
+            print('Insert Values')
             
             pass
 
@@ -84,7 +84,7 @@ curs.execute("select data from other where name = 'port'")
 rep_data = curs.fetchall()
 if not rep_data:
     while 1:
-        print('포트 : ', end = '')
+        print('Port : ', end = '')
         rep_port = int(input())
 
         if rep_port:
@@ -95,13 +95,13 @@ if not rep_data:
             pass
 else:
     rep_port = rep_data[0][0]
-    print('포트 : ' + str(rep_port))
+    print('Port : ' + str(rep_port))
 
 curs.execute("select data from other where name = 'key'")
 rep_data = curs.fetchall()
 if not rep_data:
     while 1:
-        print('비밀 키 : ', end = '')
+        print('Secret Key : ', end = '')
         rep_key = str(input())
 
         if rep_key:
@@ -112,7 +112,7 @@ if not rep_data:
             pass
 else:
     rep_key = rep_data[0][0]
-    print('비밀 키 : ' + rep_key)
+    print('Secret Key : ' + rep_key)
 
 print('')
 
@@ -181,9 +181,9 @@ if not os.path.exists('views'):
 def back_up():
     try:
         shutil.copyfile(set_data['db'] + '.db', 'back_' + set_data['db'] + '.db')
-        print('백업 성공')
+        print('Back Up Ok')
     except:
-        print('백업 오류')
+        print('Back Up Error')
 
     threading.Timer(60 * 60 * back_time, back_up).start()
 
@@ -196,12 +196,12 @@ except:
     
 # 백업 여부 확인
 if back_time != 0:
-    print(str(back_time) + '시간 간격으로 백업')
+    print(str(back_time) + ' Hours Back Up')
 
     if __name__ == '__main__':
         back_up()
 else:
-    print('백업하지 않음')
+    print('No Back Up')
 
 @app.route('/del_alarm')
 def del_alarm():
@@ -823,7 +823,7 @@ def indexing():
 
     if index_data:
         for delete_index in index_data:
-            print('delete : ' + delete_index[0])
+            print('Delete : ' + delete_index[0])
             
             sql = 'drop index if exists ' + delete_index[0]
 
@@ -843,7 +843,7 @@ def indexing():
             r_cul = re.findall('(?:([^ (]*) text)', str(cul[0]))
             
             for n_cul in r_cul:
-                print('create : index_' + table[0] + '_' + n_cul)
+                print('Create : index_' + table[0] + '_' + n_cul)
                 
                 sql = 'create index index_' + table[0] + '_' + n_cul + ' on ' + table[0] + '(' + n_cul + ')'
                 
@@ -864,7 +864,7 @@ def re_start():
         return re_error(conn, '/error/3')
 
     print('')
-    print('서버 재 시작')
+    print('Re Start')
     print('')
 
     os.execl(sys.executable, sys.executable, *sys.argv)

+ 2 - 2
func.py

@@ -63,7 +63,7 @@ def captcha_post(test, conn, num = 1):
 def ip_warring(conn):
     curs = conn.cursor()
 
-    if(custom(conn)[2] == 0):    
+    if custom(conn)[2] == 0:    
         curs.execute('select data from other where name = "no_login_warring"')
         data = curs.fetchall()
         if data and data[0][0] != '':
@@ -212,7 +212,7 @@ def ip_pas(conn, raw_ip):
     hide = 0
     curs = conn.cursor()
     if re.search("(\.|:)", raw_ip):
-        if(not re.search("^도구:", raw_ip)):    
+        if not re.search("^도구:", raw_ip):    
             curs.execute("select data from other where name = 'ip_view'")
             d = curs.fetchall()
             if d and d[0][0] != '':

+ 3 - 3
mark.py

@@ -75,12 +75,12 @@ def namumark(conn, title, data, num, in_c, toc_y):
     data = table(data)
     data = end(data, category)
 
-    data += '<script>function folding(num) { var fol = document.getElementById(\'folding_\' + num); \
+    data += '<script>function folding(num, test = 0) { var fol = document.getElementById(\'folding_\' + num); \
             if(fol.style.display == \'inline-block\' || fol.style.display == \'block\') { fol.style.display = \'none\'; } \
-            else { if(num % 3 == 0) { fol.style.display = \'block\'; } else { fol.style.display = \'inline-block\'; } } } \
+            else { if(num % 3 == 0 && test != 1) { fol.style.display = \'block\'; } else { fol.style.display = \'inline-block\'; } } } \
             </script>'
     
-    if(num == 1):        
+    if num == 1:        
         for d4 in backlink:
             t = threading.Thread(target = plusing, args = [conn, d4[0], d4[1], d4[2]])
             t.start()

+ 6 - 27
readme.md

@@ -1,38 +1,17 @@
 ## 개요
-오픈나무 정식 버전 입니다. 파이썬 Bottle 기반으로 돌아 갑니다.
+오픈나무 정식 버전 입니다. 파이썬으로 돌아 갑니다.
 
-## 설치법
-밑의 의존성을 설치하고 app.py를 파이썬 3.5 이상 버전으로 실행하세요.
-
-첫 번째 가입자에게 소유자 권한이 부여됩니다.
-
-## 기타
- * [테스트 서버](http://namu.ml/)
- 
-## 클론하는 방법
+## 클론 명령어
 ### 일반
  * git clone https://github.com/2DU/openNAMU.git
 
 ### 베타
- * git clone -b master https://github.com/2DU/openNAMU.git 
- 
-## 의존성
- * [파이썬](https://www.python.org/downloads/) 3.5 이상
- 
-### 윈도우
- * pip install -r requirements.txt
- 
-cmd에 치면 됩니다.
-### 우분투
- * sudo apt-get install python3-pip
- * pip3 install -r requirements.txt
- 
-터미널에 치면 됩니다.
-### 자세한 설명
+ * git clone -b master https://github.com/2DU/openNAMU.git
+
+## 설치법
  * [참조](http://namu.ml/w/오픈나무%2F설치법)
  
 ## set.json 설명
  * db = 데이터베이스 이름
- * port = 위키 열 포트 (기본 : 3000)
 
-set.json를 삭제하면 다시 새로 만들 수 있습니다.
+set.json를 삭제하면 다시 새로 만들 수 있습니다.

+ 21 - 0
readme.txt

@@ -0,0 +1,21 @@
+## 개요
+오픈나무 정식 버전 입니다. 파이썬으로 돌아 갑니다.
+
+## 클론 명령어
+### 일반
+ * git clone https://github.com/2DU/openNAMU.git
+
+### 베타
+ * git clone -b master https://github.com/2DU/openNAMU.git
+ 
+## 설치법
+ * [참조](http://namu.ml/w/오픈나무%2F설치법)
+ 
+## set.json 설명
+ * db = 데이터베이스 이름
+
+set.json를 삭제하면 다시 새로 만들 수 있습니다.
+
+## 기타
+ * [테스트 서버](http://namu.ml/)
+ * 첫 번째 가입자에게 소유자 권한이 부여됩니다.

+ 10 - 16
set_mark/footnote.py

@@ -25,27 +25,27 @@ def footnote(data, fol_num):
                             break
                             
                     if none_this == 0:
-                        data = pop_re.sub("<sup><a href='javascript:void(0);' onclick='folding(" + str(fol_num) + ");' id='rfn-" + str(a) + "'>[" + results[0] + "]</a></sup>" + \
+                        data = pop_re.sub("<sup><a href='javascript:void(0);' onclick='folding(" + str(fol_num) + ", 1);' id='rfn-" + str(a) + "'>(" + results[0] + ")</a></sup>" + \
                                         "<div class='popup' style='display: none;' id='folding_" + str(fol_num) + "'><a onclick='folding(" + str(fol_num) + ");'" + \
-                                        " href='#fn-" + str(a) + "'>#d#" + results[0] + "#/d#</a> <a href='javascript:void(0);' onclick='folding(" + str(fol_num) + ");'>[X]</a> " + \
+                                        " href='#fn-" + str(a) + "'>(" + results[0] + ")</a> <a href='javascript:void(0);' onclick='folding(" + str(fol_num) + ");'>(X)</a> " + \
                                          namu[i + 1] + "</div>", data, 1)
                     else:
-                        data = pop_re.sub("<sup><a href='javascript:void(0);' id='rfn-" + str(a) + "'>#d#" + results[0] + "#/d#</a></sup>", data, 1)
+                        data = pop_re.sub("<sup><a href='javascript:void(0);' id='rfn-" + str(a) + "'>(" + results[0] + ")</a></sup>", data, 1)
                 else:
                     if(results[0]):                
                         namu += [results[0]]
                         namu += [results[1]]
 
-                        tou += "<span id='footnote-list'><a href='#rfn-" + str(a) + "' id='fn-" + str(a) + "'>[" + results[0] + "]</a> " + results[1] + "</span><br>"
-                        data = pop_re.sub("<sup><a href='javascript:void(0);' onclick='folding(" + str(fol_num) + ");' id='rfn-" + str(a) + "'>#d#" + results[0] + "#/d#</a>" + \
+                        tou += "<span id='footnote-list'><a href='#rfn-" + str(a) + "' id='fn-" + str(a) + "'>(" + results[0] + ")</a> " + results[1] + "</span><br>"
+                        data = pop_re.sub("<sup><a href='javascript:void(0);' onclick='folding(" + str(fol_num) + ", 1);' id='rfn-" + str(a) + "'>(" + results[0] + ")</a>" + \
                                         "</sup><div class='popup' style='display: none;' id='folding_" + str(fol_num) + "'><a onclick='folding(" + str(fol_num) + ");'" + \
-                                        " href='#fn-" + str(a) + "'>#d#" + results[0] + "#/d#</a> <a href='javascript:void(0);' onclick='folding(" + str(fol_num) + ");'>" + \
-                                        "#d#X#/d#</a> " + results[1] + "</div>", data, 1)     
+                                        " href='#fn-" + str(a) + "'>(" + results[0] + ")</a> <a href='javascript:void(0);' onclick='folding(" + str(fol_num) + ");'>" + \
+                                        "(X)</a> " + results[1] + "</div>", data, 1)     
                     else:                    
-                        tou += "<span id='footnote-list'><a href='#rfn-" + str(a) + "' id='fn-" + str(a) + "'>[" + str(a) + "]</a> " + results[1] + "</span><br>"
-                        data = pop_re.sub('<sup><a href="javascript:void(0);" onclick="folding(' + str(fol_num) + ');" id="rfn-' + str(a) + '">#d#' + str(a) + '#/d#</a></sup>' + \
+                        tou += "<span id='footnote-list'><a href='#rfn-" + str(a) + "' id='fn-" + str(a) + "'>(" + str(a) + ")</a> " + results[1] + "</span><br>"
+                        data = pop_re.sub('<sup><a href="javascript:void(0);" onclick="folding(' + str(fol_num) + ', 1);" id="rfn-' + str(a) + '">(' + str(a) + ')</a></sup>' + \
                                         '<div class="popup" style="display: none;" id="folding_' + str(fol_num) + '"><a onclick="folding(' + str(fol_num) + ');"' + \
-                                        ' href="#fn-' + str(a) + '">#d#' + str(a) + '#/d#</a> <a href="javascript:void(0);" onclick="folding(' + str(fol_num) + ');">#d#X#/d#</a> ' + \
+                                        ' href="#fn-' + str(a) + '">(' + str(a) + ')</a> <a href="javascript:void(0);" onclick="folding(' + str(fol_num) + ');">(X)</a> ' + \
                                         results[1] + '</div>', data, 1)
                     a += 1
 
@@ -55,8 +55,6 @@ def footnote(data, fol_num):
 
                 if tou == "<hr style='margin-top: 30px;' id='footnote'><div><br></div>":
                     tou = ""
-                else:
-                    tou = re.sub('#d#(?P<in>(?:(?!#\/d#).)*)#\/d#', '[\g<in>]', tou)
 
                 data = pop_re.sub("<br>" + tou, data, 1)
                 tou = "<hr style='margin-top: 30px;' id='footnote'><div><br>"
@@ -65,12 +63,8 @@ def footnote(data, fol_num):
 
             if tou == "<hr style='margin-top: 30px;' id='footnote'><div><br></div>":
                 tou = ""
-            else:
-                tou = re.sub('#d#(?P<in>(?:(?!#\/d#).)*)#\/d#', '[\g<in>]', tou)
 
             break
-            
-    data = re.sub('#d#(?P<in>(?:(?!#\/d#).)*)#\/d#', '[\g<in>]', data)
     
     data = re.sub("\[각주\](?:(?:<br>| |\r|\n)+)?$", "", data)
     data = re.sub("(?:(?:<br>| |\r|\n)+)$", "", data)

+ 4 - 2
set_mark/link.py

@@ -29,11 +29,13 @@ def link(conn, title, data, num, category, backlink):
                 category += ' / '                
 
             style = ''
+            title_name = re.sub("분류:", "", g[0])
             if g[1]:
                 if re.search('#blur', g[1]):
-                    style = ' style="filter: blur(3px);" onmouseover="this.style.filter=\'none\';" onmouseout="this.style.filter=\'blur(3px)\';"'
+                    style = ' onmouseover="this.innerHTML=\'' + title_name + '\';"'
+                    title_name = '<span id="inside">스포일러</span>'
                 
-            category += '<a ' + red + ' ' + style + ' href="/w/' + url_pas(g[0]) + '">' + re.sub("분류:", "", g[0]) + '</a>'
+            category += '<a ' + red + ' ' + style + ' href="/w/' + url_pas(g[0]) + '">' + title_name + '</a>'
         
         data = re.sub("\[\[(분류:(?:(?:(?!\]\]|#).)+))((?:#(?:(?:(?!#|\]\]).)+))+)?\]\]", '', data, 1)
     

+ 6 - 10
version.md

@@ -152,21 +152,17 @@
  * 구문 강조 [highlightjs](https://highlightjs.org/)
  * 수식 [MathJax](https://www.mathjax.org/)
 
-## 도움 준 사람이나 팀
- * [Basix](https://twitter.com/Basix1120)
- * Efrit
+## 도움 준 사람들
  * [Team Croatia](https://github.com/TeamCroatia)
- * 기타 텔레그램 및 카카오톡 채팅방 사람들
+ * Basix
+ * Efrit
+ * 기타 채팅방 사람들
 
 ----
 ## 기타
- * 현재 버전 : v2.6.3
+ * 현재 버전 : v2.6.4
 
 ----
 ## 개발 이념
- * 타 위키 엔진과 같지는 않게
  * 최대한 간단하게
- * 설치하고 바로 쓸 수 있게
- * 개발하기 편하게
- * 가볍게
- * **나한테 맞는 위키 엔진을 만들자**
+ * 개발하기 편하게

+ 6 - 1
views/acme/css/style-responsive.css

@@ -558,4 +558,9 @@ table#toron tbody tr td {
 
 ul#redirect {
     margin-bottom: 0;
-}
+}
+
+html, body { 
+    max-width: 100%; 
+    overflow-x: hidden; 
+}