Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

word md 分类目录,word 中文文件名 #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mycherish
Copy link

No description provided.

@@ -49,7 +49,10 @@ def iter_block_items(self, parent):
yield Table(child, parent)

def parse(self, result, detail) -> Tuple[str, str, List[str]]:
document = self.request.get_word(detail["path"])
leval = result["level"].strip()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

level*

# 扩展名
filenameExt = filename.split(".")[-1]
first_path = title.split('/')
self.cache.word_output_path(first_path[1], CacheType.WordDocument, first_path[0])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的干什么的?返回值没有在用。如果是为了确保目录存在,用 path("", CacheType.WordDocument, first_path[0]) 应该可以达到一样的效果

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我试了一下这样貌似不行,我这样写 self.cache.path(first_path[1], CacheType.WordDocument, first_path[0])
会报错[Errno 2] No such file or directory: '__cache__/words/行政法规/城市公共交通条例.docx'
我看path的逻辑只能创建一出__cache__/words/这个目录,第三个参数貌似是扩展名 key = f"{key}.{filetype}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants