test_tool.py 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. # Load
  2. import time
  3. import os
  4. import platform
  5. import urllib
  6. import zipfile
  7. from route.tool.func import *
  8. data_db_set = class_check_json()
  9. db_data_get(data_db_set['type'])
  10. do_db_set(data_db_set)
  11. load_db = get_db_connect()
  12. conn = load_db.__enter__()
  13. curs = conn.cursor()
  14. print('----')
  15. print('1. Add virtual doc')
  16. print('----')
  17. what_i_do = input('Select : ')
  18. if what_i_do == '1':
  19. print('----')
  20. doc_count = int(input('Count : '))
  21. for for_a in range(doc_count):
  22. name = 'test_' + str(for_a)
  23. content = '''[include(틀:주요 문서)]
  24. [include(틀:위키 엔진)]
  25. ||||<tablealign=right><tablebordercolor=#008679><#008679> {{{#white {{{+2 오픈나무
  26. ''\'openNAMU\'''}}}}}} ||
  27. |||| [[파일:오픈나무 로고.png|width=200px]] ||
  28. ||<colbgcolor=#008679><colcolor=white> 현재 상태 || ~~계속~~ 개발 중 ||
  29. |||| 최신 빌드 ||
  30. || stable || v3.4.5 (stable1) (beta3) (dev14) ||
  31. || beta || v3.4.6-RC1 (stable1) (beta8-107) ||
  32. || dev || v3.4.6-RC1 (stable1) (beta8-107)[* 거의 매일 바뀜] ||
  33. |||| 역사 ||
  34. || nodeJS || 2016-04-23 ||
  35. || Python || 2017-01-06 ||
  36. || 링크 || [[https://github.com/openNAMU/openNAMU|깃허브]]
  37. [[https://github.com/openNAMU|스킨, 서브 자료들]] ||
  38. [목차]
  39. [clearfix]
  40. == 개요 ==
  41. [[나무마크]]를 ~~대충~~ 지원하는 [[파이썬]] 위키 엔진임다.
  42. == 왜 오픈나무임? ==
  43. [[basix|원래 개발자]]가 [[더 시드]] 같은 엔진을 만들겠다라는 명목하에 open[[나무위키|NAMU]]라고 지었습니다.
  44. == 왜 만듬? ==
  45. 과거에는 저도 [[대한위키실록|위키]]를 열어봤던 사람으로써 [[도쿠위키]]와 [[모니위키]], [[미디어위키]]를 쓰다 불편한 점을 개선하기 위해서 새로 만들었슴다.
  46. [[미디어위키]]는 정말 좋은 엔진이지만 아무래도 한국적 특성에 뭔가 안 맞는 것 같아서 이걸 만들었슴다.
  47. 참고로 쓰다보면 이런 게 왜 있지? 싶은 요소가 있는데[* 예를 들면 틀 링크] 그건 그냥 제가 쓰려고 만들었슴다.
  48. === 영향을 많이 받은 위키 관련 요소 ===
  49. [include(틀:오픈나무 개발 이유)]
  50. == 역사 ==
  51. * [[/역사]]
  52. * [[/v3.4.6]]
  53. == 개발 이념 ==
  54. * [[/개발 이념]]
  55. == 주의 ==
  56. * 프로덕션 용으로는 사용 안하는 걸 권장 드립니다. ~~[[시한폭탄|언제 터질 지 모릅니다]]~~
  57. == 사용하는 위키 ==
  58. * [[/사용 위키]]
  59. == 나머지 개발자의 헛소리 적는 공간 ==
  60. * [[/연구]]
  61. * [[/차기 계획]]
  62. * [[/개발 현황]]
  63. * [[/반성]]
  64. [[분류:오픈나무]]'''
  65. today = get_time()
  66. send = 'test'
  67. ip = '127.0.0.1'
  68. leng = '0'
  69. curs.execute(db_change("insert into data (title, data) values (?, ?)"), [name, content])
  70. print(for_a)
  71. test_case = [[
  72. for_b,
  73. name,
  74. content,
  75. today,
  76. ip,
  77. send,
  78. leng,
  79. ''
  80. ] for for_b in range(1, 151)]
  81. curs.executemany(db_change(
  82. "insert into history (id, title, data, date, ip, send, leng, hide, type) " + \
  83. "values (?, ?, ?, ?, ?, ?, ?, '', ?)"
  84. ), test_case)
  85. conn.commit()