Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 74df385

Browse filesBrowse files
committed
Ajustado o script de geração de epub
1 parent 3b87d94 commit 74df385
Copy full SHA for 74df385

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Open diff view settings
Collapse file

‎util/epub.py‎

Copy file name to clipboardExpand all lines: util/epub.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ def _fix_images_url(files, tmp_dir):
1919
"""
2020
makedirs(tmp_dir)
2121
fixed_files = []
22+
fixed_path = path.relpath(_project_path())
2223
for fp in files:
2324
file_name = path.split(fp)[1]
2425
output = path.join(tmp_dir, file_name)
2526
with open(fp) as input_file:
26-
fixed_str = input_file.read().replace('https://github.com/PenseAllen/PensePython2e/raw/master/', '../')
27+
fixed_str = input_file.read().replace('https://github.com/PenseAllen/PensePython2e/raw/master', fixed_path)
2728
with open(output, 'w') as output_file:
2829
output_file.write(fixed_str)
2930
fixed_files.append(output)
@@ -53,6 +54,5 @@ def main():
5354
print('Gerado epub em', output)
5455

5556

56-
5757
if __name__ == '__main__':
5858
main()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.