Commit graph

96 commits

Author SHA1 Message Date
Ethan Dalool
1f1b36b173 Assign opf, opf_filepath normally instead of mutating in method. 2020-01-20 17:34:51 -08:00
Ethan Dalool
6386f25cd4 Rearrange the lines in delete_file.
If anything is going to raise an exception here I expect it to be
the item missing from the manifest. In which case let's get that out
of the way early and only delete from disk at the very end.
2020-01-20 17:33:58 -08:00
Ethan Dalool
fd73ecfe2e Add, improve some comments, docstrings, exception texts. 2020-01-20 17:32:47 -08:00
Ethan Dalool
973731f797 Add argument demote_headers to merge. 2020-01-20 17:10:22 -08:00
Ethan Dalool
324689ea3c Replace glob with winglob. 2020-01-20 17:06:27 -08:00
Ethan Dalool
ebde327cce Change email in setup.py. 2020-01-18 22:41:32 -08:00
Ethan Dalool
73d88e12ce Move covercomesfirst's save line back to the argparse func.
Because args doesn't exist in the other function. oops.
2020-01-02 20:13:09 -08:00
Ethan Dalool
96650c2886 During opf normalize, ensure ncx mimetype is correct. 2020-01-02 20:12:08 -08:00
Ethan Dalool
046e8d9394 Bump to version 0.0.4. 2019-12-30 13:53:49 -08:00
Ethan Dalool
636b936539 Add argument number_headerfile to get index in the h1. 2019-12-30 13:53:12 -08:00
Ethan Dalool
fa65157779 When merging, start indices at 1 instead of 0.
When going through the resulting merged book in sigil, it's
confusing to remember that the index prefix on every file is not
actually the number of the book that you're working on, especially
if it's a numbered series of books.
2019-12-30 13:52:08 -08:00
Ethan Dalool
261faf66ae Treat addfile arguments as glob patterns. 2019-12-30 13:50:05 -08:00
Ethan Dalool
f29677d4e0 Add missing generate_toc to help text. 2019-12-30 13:48:37 -08:00
Ethan Dalool
2e070b5fa9 Add step for normalizing the opf file specifically. 2019-12-30 13:48:06 -08:00
Ethan Dalool
0075121607 Bump to version 0.0.3. 2019-09-10 15:25:27 -07:00
Ethan Dalool
1da9d93ec6 Add command exec. 2019-09-08 21:25:35 -07:00
Ethan Dalool
7cbdff827e Fix calculation of merge index, after globbing. 2019-09-08 21:25:10 -07:00
Ethan Dalool
5416276b00 Fix relink behavior when subfolder exists with wrong casing. 2019-09-06 16:54:40 -07:00
Ethan Dalool
70d3bdb2ae Add some docstrings to the interlinking functions. 2019-09-06 16:53:02 -07:00
Ethan Dalool
bddecab51f Recognize mimetype for xpgt. 2019-09-06 16:26:16 -07:00
Ethan Dalool
6d4200eb7c Alphabetize the extension mimetypes and mime directories. 2019-09-06 16:25:57 -07:00
Ethan Dalool
fc07652d16 Add some prototypical validation code. 2019-09-06 15:44:28 -07:00
Ethan Dalool
8763cf6c6c Let merge take glob patterns. 2019-09-06 15:39:26 -07:00
Ethan Dalool
60d9d646a2 Add argument _original_epub_filepath for better messaging later.
Printing the tempdir is not very helpful, so if we need to print
something about this epub file we can use _original_path to get
the epub if it was a .open() or the tempdir if it was .new().
2019-09-06 15:38:51 -07:00
Ethan Dalool
9821125f2c Recognize directory for application/x-font-ttf. 2019-09-06 15:36:51 -07:00
Ethan Dalool
9e020eaa11 Add method generate_toc and commandline command. 2019-08-29 16:44:57 -07:00
Ethan Dalool
365c28bfdb Add more formatters into NCX_TEMPLATE, NAV_TEMPLATE. 2019-08-29 16:34:54 -07:00
Ethan Dalool
f93309a37c Let holdit take many books. 2019-08-29 13:46:34 -07:00
Ethan Dalool
4d224e7d6a Rename argument only_linear to linear_only. 2019-08-29 13:45:33 -07:00
Ethan Dalool
faa0e9c7e3 Bail early if rename_map is empty. 2019-08-18 22:39:41 -07:00
Ethan Dalool
34ce1bac56 Don't add unchanged paths to the rename_map. 2019-08-18 22:39:02 -07:00
Ethan Dalool
87f1de1dc5 In move_nav_to_end, add nav to spine if not present. 2019-08-18 22:38:40 -07:00
Ethan Dalool
0004b53032 Fix holdit command undoing manual opf changes. 2019-08-18 22:38:05 -07:00
Ethan Dalool
cf08ce3570 Let covercomesfirst and normalize take many books via glob. 2019-08-18 19:55:41 -07:00
Ethan Dalool
7b4f4cdb1f Use font/ mimes instead of application/font- 2019-08-18 19:55:05 -07:00
Ethan Dalool
a9102cf877 Add the holdit command. 2019-08-18 19:53:54 -07:00
Ethan Dalool
d15977330b Add pip install to the readme. 2019-08-06 23:51:34 -07:00
Ethan Dalool
cac8712684 Bump version to 0.0.2. 2019-08-06 23:49:58 -07:00
Ethan Dalool
d77dcacc21 Initial commandline utilities. 2019-08-06 23:49:47 -07:00
Ethan Dalool
89420ff5d7 Add some simple getters for authors, languages, and titles. 2019-08-06 23:39:39 -07:00
Ethan Dalool
0364b87cf3 When normalizing, OEBPS exist_ok=True.
I hadn't considered that the content.opf would be in the root when
there is an OEBPS dir present. There's a whole weird world out there.
2019-08-06 23:38:56 -07:00
Ethan Dalool
29eea3855c Add method assert_id_not_exists for pre-creation checks.
At the moment it's only used once but it looks nice to have it
paired with the other assert also used in the add_file method.
2019-08-06 23:37:14 -07:00
Ethan Dalool
5ba482753c Add .htm to the mimetype fixer dict. 2019-08-06 23:36:13 -07:00
Ethan Dalool
54ae615730 Set default book language to be undetermined (und).
Per rfc5646, omitting is preferred where permitted, but in Epub
that's not permitted!
2019-08-05 17:54:37 -07:00
Ethan Dalool
f191b86573 Add setup.py. 2019-08-04 00:13:27 -07:00
Ethan Dalool
58c3de6c5d Initial commit. 2019-08-03 22:13:27 -07:00