Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
天驴滚滚
Tagdox
提交
15c9f4cc
T
Tagdox
项目概览
天驴滚滚
/
Tagdox
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Tagdox
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
15c9f4cc
编写于
10月 06, 2021
作者:
H
horsesword
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复了在非NTFS磁盘上的兼容性bug。
上级
dcd470d2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
52 addition
and
13 deletion
+52
-13
README.md
README.md
+14
-0
tagdox.py
tagdox.py
+31
-13
更新记录.md
更新记录.md
+7
-0
未找到文件。
README.md
浏览文件 @
15c9f4cc
...
...
@@ -57,8 +57,22 @@ Tagdox / 标签文库,是用于对文档进行「标签化管理」的免费
## 近期更新
#### v0.21.1.2 2021年10月6日
修复了在非NTFS磁盘上的兼容性bug。
文件夹区域也增加了鼠标指向效果。
修改自建模块位置。
#### v0.21.1.1 2021年10月4日
储备:优化标签类封装逻辑,关闭文件前一直占用文件。
储备:新增常用工具函数,直接对标签进行增加、删除、清空、查询。
储备:新增依赖说明requirements.txt。
#### v0.21.1.0 2021年10月4日
为文件列表的鼠标指向增加了高亮效果。
#### v0.21.0.0 2021年10月3日
优化标签逻辑,采用NTFS流模式,不再影响文件名(测试版)。
优化右键响应,现在可以正确在被点击的项目处出现右键菜单了。
...
...
tagdox.py
浏览文件 @
15c9f4cc
...
...
@@ -47,11 +47,12 @@ URL_HELP = 'https://gitee.com/horse_sword/my-local-library' # 帮助的超链
URL_ADV
=
'https://gitee.com/horse_sword/my-local-library/issues'
# 提建议的位置
URL_CHK_UPDATE
=
'https://gitee.com/horse_sword/my-local-library/releases'
# 检查更新的位置
TAR
=
'Tagdox / 标签文库'
# 程序名称
VER
=
'v0.21.1.
1
'
# 版本号
VER
=
'v0.21.1.
2
'
# 版本号
"""
## 近期更新说明
#### v0.21.1.1 2021年10月5日
#### v0.21.1.2 2021年10月6日
修复了在非NTFS磁盘上的兼容性bug。
文件夹区域也增加了鼠标指向效果。
修改自建模块位置。
#### v0.21.1.0 2021年10月4日
...
...
@@ -716,7 +717,10 @@ def get_file_part(tar): #
try
:
with
open
(
tar
+
":tags"
,
"r"
,
encoding
=
"utf8"
)
as
f
:
ftags
+=
(
set
(
list
(
map
(
lambda
x
:
x
.
strip
(),
f
.
readlines
()))))
except
FileNotFoundError
as
e
:
except
FileNotFoundError
:
pass
except
Exception
as
e
:
# print(e)
pass
mtime
=
os
.
stat
(
tar
).
st_mtime
# 修改时间
...
...
@@ -726,6 +730,8 @@ def get_file_part(tar): #
fsize
=
os
.
path
.
getsize
(
tar
)
# 文件大小,字节
fsize_k
=
fsize
/
(
1024
)
# 换算到kB
if
0
<
fsize_k
<
0.1
:
fsize_k
=
0.1
fsize_k
=
round
(
fsize_k
,
1
)
# 对文件目录的解析算法2:
...
...
@@ -2844,6 +2850,7 @@ def exec_file_add_tag(filename, tag0, need_update=True):
"""
filename
=
filename
.
replace
(
'
\\
'
,
'/'
)
tmp_final_name
=
filename
ntfs_error
=
False
#
# 增加NTFS流的标签解析
if
TAG_METHOD
==
'FILE_STREAM'
:
...
...
@@ -2857,8 +2864,11 @@ def exec_file_add_tag(filename, tag0, need_update=True):
# 增加标签
tags_old
.
append
(
tag0
)
tags_old
.
sort
()
with
open
(
filename
+
":tags"
,
"w"
,
encoding
=
"utf8"
)
as
f
:
f
.
writelines
(
list
(
map
(
lambda
x
:
x
+
"
\n
"
,
tags_old
)))
try
:
with
open
(
filename
+
":tags"
,
"w"
,
encoding
=
"utf8"
)
as
f
:
f
.
writelines
(
list
(
map
(
lambda
x
:
x
+
"
\n
"
,
tags_old
)))
except
:
ntfs_error
=
True
#
# 更新缓存
update_one_of_dicT
(
filename
)
...
...
@@ -2871,7 +2881,8 @@ def exec_file_add_tag(filename, tag0, need_update=True):
# str(tmp['full_path']))
# dicT[filename] = tmp_v
# return tmp_final_name
else
:
if
TAG_METHOD
!=
'FILE_STREAM'
or
ntfs_error
:
tag_list
=
tag0
.
split
(
V_SEP
)
tag_old
=
get_file_part
(
filename
)[
'ftags'
]
# 已有标签
file_old
=
get_file_part
(
filename
)[
'ffname'
]
# 原始的文件名
...
...
@@ -2881,7 +2892,7 @@ def exec_file_add_tag(filename, tag0, need_update=True):
old_n
=
path_old
+
'/'
+
fname
+
fename
new_n
=
old_n
for
i
in
tag_list
:
if
not
i
in
tag_old
:
if
i
not
in
tag_old
:
new_n
=
path_old
+
os
.
sep
+
fname
+
V_SEP
+
i
+
fename
print
(
old_n
)
print
(
new_n
)
...
...
@@ -4369,7 +4380,7 @@ def exec_tree_file_drop_tag(event=None):
try
:
with
open
(
tmp_full_name
+
":tags"
,
"r"
,
encoding
=
"utf8"
)
as
f
:
tags_in_st
=
list
(
set
(
list
(
map
(
lambda
x
:
x
.
strip
(),
f
.
readlines
()))))
except
FileNotFoundError
as
e
:
except
Exception
as
e
:
pass
#
if
tag_value
in
tags_in_st
:
...
...
@@ -4377,10 +4388,13 @@ def exec_tree_file_drop_tag(event=None):
tags_in_st
.
remove
(
tag_value
)
# 重写流
tags_in_st
.
sort
()
with
open
(
tmp_full_name
+
":tags"
,
"w"
,
encoding
=
"utf8"
)
as
f
:
f
.
writelines
(
list
(
map
(
lambda
x
:
x
+
"
\n
"
,
tags_in_st
)))
# 更新缓存
update_one_of_dicT
(
tmp_full_name
)
try
:
with
open
(
tmp_full_name
+
":tags"
,
"w"
,
encoding
=
"utf8"
)
as
f
:
f
.
writelines
(
list
(
map
(
lambda
x
:
x
+
"
\n
"
,
tags_in_st
)))
# 更新缓存
update_one_of_dicT
(
tmp_full_name
)
except
:
pass
#
# 删除文件名里面的标签
res
=
get_file_part
(
tmp_full_name
)
...
...
@@ -4572,6 +4586,8 @@ def show_popup_menu_file(event):
tmp_tags
.
append
(
i
)
except
FileNotFoundError
as
e
:
pass
except
:
pass
try
:
for
i
in
range
(
10000
):
# 删除已有标签
...
...
@@ -4630,6 +4646,8 @@ def show_popup_menu_file(event):
tmp_tags
.
append
(
i
)
except
FileNotFoundError
as
e
:
pass
except
:
pass
#
if
file_checked
==
0
:
tmp_tags_from_files
+=
tmp_tags
...
...
@@ -4678,7 +4696,7 @@ def fixed_map_v2(tar, option):
def
exec_tree_folder_remove_mouse_highlight
(
event
):
exec_tree_folder_mouse_highlight
(
event
,
clear_only
=
True
)
exec_tree_folder_mouse_highlight
(
event
,
clear_only
=
True
)
def
exec_tree_folder_mouse_highlight
(
event
,
clear_only
=
False
):
...
...
更新记录.md
浏览文件 @
15c9f4cc
...
...
@@ -10,10 +10,17 @@
## 更新记录
#### v0.21.1.2 2021年10月6日
修复了在非NTFS磁盘上的兼容性bug。
文件夹区域也增加了鼠标指向效果。
修改自建模块位置。
#### v0.21.1.1 2021年10月4日
储备:优化标签类封装逻辑,关闭文件前一直占用文件。
储备:新增常用工具函数,直接对标签进行增加、删除、清空、查询。
储备:新增依赖说明requirements.txt。
#### v0.21.1.0 2021年10月4日
为文件列表的鼠标指向增加了高亮效果。
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录