-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
129 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,7 +130,6 @@ dmypy.json | |
.tmp/ | ||
*_result.json | ||
release/ | ||
config.json | ||
dumped_pages/ | ||
config_multi.json | ||
buffer_file/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{ | ||
"*backup_type": "multi", | ||
"single": { | ||
"*backup_token": "secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", | ||
"*page_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", | ||
"-page_type": "page", | ||
"-dump_path": "测试-功能测试2", | ||
"export_child_page": true, | ||
"page_parser_type": "md", | ||
"db_parser_type": "md", | ||
"db_insert_type": "content" | ||
}, | ||
"multi": { | ||
"*backup_token": "secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", | ||
"*backup_info_token": "secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", | ||
"*backup_list_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", | ||
"*backup_log_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", | ||
"backup_list_map": { | ||
"page_id": "页面ID", | ||
"page_type": "页面类型", | ||
"dump_path": "备份位置", | ||
"dump_status": "备份", | ||
"db_insert_type": "数据库嵌入类型" | ||
}, | ||
"backup_log_map": { | ||
"title": "时间戳", | ||
"date": "备份时间", | ||
"status": "备份状态", | ||
"log": "备注" | ||
}, | ||
"auto_check_off": true | ||
}, | ||
"use_buffer": true, | ||
"debug": false, | ||
"auto_close": true, | ||
"page_properties": true, | ||
"datetime_formate": "%Y/%m/%d-%H:%M:%S", | ||
"date_formate": "%Y/%m/%d", | ||
"file_with_link": false, | ||
"color_theme": "light", | ||
"your_color_theme": { | ||
"f_gray": "#787774", | ||
"f_brown": "#9F6B53", | ||
"f_orange": "#D9730D", | ||
"f_yellow": "#CB912F", | ||
"f_green": "#448361", | ||
"f_blue": "#337EA9", | ||
"f_purple": "#9065B0", | ||
"f_pink": "#C14C8A", | ||
"f_red": "#D44C47", | ||
"b_gray": "#F1F1EF", | ||
"b_brown": "#F4EEEE", | ||
"b_orange": "#FBECDD", | ||
"b_yellow": "#FBF3DB", | ||
"b_green": "#EDF3EC", | ||
"b_blue": "#E7F3F8", | ||
"b_purple": "#F4F0F7CC", | ||
"b_pink": "#F9EEF3CC", | ||
"b_red": "#FDEBEC", | ||
"d_light_gray": "#E3E2E080", | ||
"d_gray": "#E3E2E0", | ||
"d_brown": "#EEE0DA", | ||
"d_orange": "#FADEC9", | ||
"d_yellow": "#FDECC8", | ||
"d_green": "#DBEDDB", | ||
"d_blue": "#D3E5EF", | ||
"d_purple": "#E8DEEE", | ||
"d_pink": "#F5E0E9", | ||
"d_red": "#FFE2DD" | ||
}, | ||
"backup_root_path": "G:\\Notion备份" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# -*- mode: python ; coding: utf-8 -*- | ||
|
||
|
||
block_cipher = None | ||
|
||
|
||
a = Analysis( | ||
['notion_backup_terminal.py'], | ||
pathex=['api/notion_dump.py', 'api/notion_dump_api.py', 'api/backup_info.py'], | ||
binaries=[], | ||
datas=[], | ||
hiddenimports=[], | ||
hookspath=[], | ||
hooksconfig={}, | ||
runtime_hooks=[], | ||
excludes=[], | ||
win_no_prefer_redirects=False, | ||
win_private_assemblies=False, | ||
cipher=block_cipher, | ||
noarchive=False, | ||
) | ||
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) | ||
|
||
exe = EXE( | ||
pyz, | ||
a.scripts, | ||
a.binaries, | ||
a.zipfiles, | ||
a.datas, | ||
[], | ||
name='notion_backup_background', | ||
debug=False, | ||
bootloader_ignore_signals=False, | ||
strip=False, | ||
upx=True, | ||
upx_exclude=[], | ||
runtime_tmpdir=None, | ||
console=False, | ||
disable_windowed_traceback=False, | ||
argv_emulation=False, | ||
target_arch=None, | ||
codesign_identity=None, | ||
entitlements_file=None, | ||
icon=['notion-dump.ico'], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
# author: delta1037 | ||
# Date: 2022/05/01 | ||
# mail:[email protected] | ||
# 打包代码 pyinstaller -F -c -i notion-dump.ico notion_backup_terminal.py -p api/notion_dump.py -p api/notion_dump_api.py -p api/backup_info.py | ||
# 终端-打包代码 pyinstaller -F -c -i notion-dump.ico notion_backup_terminal.py -p api/notion_dump.py -p api/notion_dump_api.py -p api/backup_info.py | ||
# 终端-打包代码 pyinstaller notion_backup_terminal.spec | ||
# 后台-打包代码 pyinstaller -F -i notion-dump.ico notion_backup_terminal.py -p api/notion_dump.py -p api/notion_dump_api.py -p api/backup_info.py | ||
# 后台-打包代码 pyinstaller notion_backup_background.spec | ||
import os | ||
import sys | ||
import time | ||
|
@@ -21,7 +24,8 @@ def __init__(self): | |
self.__log = open(LOG_FILE, "a+", encoding='utf-8') | ||
# 输出备份的时间 | ||
backup_time = time.strftime('backup_time: %Y-%m-%d %H:%M:%S\n', time.localtime(time.time())) | ||
self.terminal.write(backup_time) | ||
if self.terminal is not None: | ||
self.terminal.write(backup_time) | ||
self.__log.write("\n###################################################\n") | ||
self.__log.write(backup_time) | ||
self.__log.flush() | ||
|
@@ -33,7 +37,8 @@ def log_info(self, message): | |
self.log("[EXPORT KERNEL] " + str(message)) | ||
|
||
def log(self, message): | ||
self.terminal.write(message + "\n") | ||
if self.terminal is not None: | ||
self.terminal.write(message + "\n") | ||
self.__log.write(message + "\n") | ||
self.__log.flush() | ||
|
||
|