Skip to content

Commit

Permalink
clean the codes.
Browse files Browse the repository at this point in the history
  • Loading branch information
bukun committed Sep 8, 2020
1 parent d4f9930 commit af1458a
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 288 deletions.
2 changes: 1 addition & 1 deletion doc/requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ htmlmin

sphinx
##################################
graphviz
# graphviz
pylint
selenium
70 changes: 0 additions & 70 deletions torcms/core/tool/access_model.py

This file was deleted.

2 changes: 1 addition & 1 deletion torcms/core/tool/sqlite_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def add(post_id):
# 使用毫秒作为ID。
millis = int(round(time.time() * 1000))

db_file = os.path.join(os.getcwd(), 'access.db')
db_file = './database/log_access.db'
conn = sqlite3.connect(db_file)
cursor = conn.cursor()
try:
Expand Down
70 changes: 0 additions & 70 deletions torcms/model/access_model.py

This file was deleted.

8 changes: 4 additions & 4 deletions torcms/script/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
from .script_drop_tabels import run_drop_tables
from .script_gen_category import run_gen_category
from .autocrud.gen_html_file import generate_html_files as run_auto
from .tmplchecker import run_checkit
# from .tmplchecker import run_checkit
from .script_sitemap import run_editmap
from .script_check200 import run_check200
from .script_dump import run_dump
from .script_zero import run_zero
from .script_update_count import run_update_count
from .script_create_sqlite import run_create_db
# from .script_create_sqlite import run_create_db


def entry(argv):
Expand All @@ -43,13 +43,13 @@ def entry(argv):
'gen_category': run_gen_category,
'auto': run_auto,
'whoosh': run_whoosh,
'html': run_checkit,
# 'html': run_checkit,
'update_cat': run_update_cat,
'check200': run_check200,
'dump': run_dump,
'update': run_update_count,
'0': run_zero,
'create_db': run_create_db,
# 'create_db': run_create_db,
}
try:
# 这里的 h 就表示该选项无参数,i:表示 i 选项后需要有参数
Expand Down
36 changes: 18 additions & 18 deletions torcms/script/script_create_sqlite.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# -*- coding: utf-8
'''
创建sqlite数据库
'''
import os
import sqlite3


def run_create_db():
db_file = os.path.join(os.getcwd(), 'access.db')
conn = sqlite3.connect(db_file)
cursor = conn.cursor()
cursor.execute('CREATE TABLE TabAccess (uid BIGINT PRIMARY KEY NOT NULL ,'
'post_id VARCHAR(5));')


if __name__ == '__main__':
run_create_db()
# # -*- coding: utf-8
# '''
# 创建sqlite数据库
# '''
# import os
# import sqlite3
#
#
# def run_create_db():
# db_file = './database/log_access.db'
# conn = sqlite3.connect(db_file)
# cursor = conn.cursor()
# cursor.execute('CREATE TABLE TabAccess (uid BIGINT PRIMARY KEY NOT NULL ,'
# 'post_id VARCHAR(5));')
#
#
# if __name__ == '__main__':
# run_create_db()
2 changes: 1 addition & 1 deletion torcms/script/script_update_count.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import os
from cfg import DB_CFG

db_file = os.path.join(os.getcwd(), 'access.db')
db_file = './database/log_access.db'
conn2 = sqlite3.connect(db_file)
cursql = conn2.cursor()

Expand Down
123 changes: 0 additions & 123 deletions torcms/script/tmplchecker/__init__.py

This file was deleted.

0 comments on commit af1458a

Please sign in to comment.