Compare commits
No commits in common. "46db1ef5eb02740810f0f53e5a047316d21e90e7" and "f1ac52f50a73947b2a4e54411243eaed46c7dae8" have entirely different histories.
46db1ef5eb
...
f1ac52f50a
11
README.md
11
README.md
|
@ -9,8 +9,6 @@ pip install fsub
|
||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
```
|
```
|
||||||
usage: fsub [-h] [-f F] [-c] [-s MS] [-n] [-j] [-u] [-r | -p] [-b B] [-e E] file [file ...]
|
|
||||||
|
|
||||||
Fix, edit and clean SubRip (.srt) files.
|
Fix, edit and clean SubRip (.srt) files.
|
||||||
|
|
||||||
positional arguments:
|
positional arguments:
|
||||||
|
@ -55,14 +53,6 @@ python -m unittest tests.unit
|
||||||
python -m unittest tests.integration
|
python -m unittest tests.integration
|
||||||
```
|
```
|
||||||
|
|
||||||
# Scripted API
|
|
||||||
An example of calling the program from Python:
|
|
||||||
```
|
|
||||||
import fsub
|
|
||||||
|
|
||||||
fsub.run('-c', 'test.srt')
|
|
||||||
```
|
|
||||||
|
|
||||||
# Features
|
# Features
|
||||||
- Fixes subtitle numbering
|
- Fixes subtitle numbering
|
||||||
- Converts files to UTF-8 encoding
|
- Converts files to UTF-8 encoding
|
||||||
|
@ -72,4 +62,3 @@ fsub.run('-c', 'test.srt')
|
||||||
- May strip HTML
|
- May strip HTML
|
||||||
- May join files together
|
- May join files together
|
||||||
- May edit files in-place
|
- May edit files in-place
|
||||||
- May cut sections out
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[metadata]
|
[metadata]
|
||||||
name = fsub
|
name = fsub
|
||||||
version = 1.0.4
|
version = 1.0.2
|
||||||
author = Augusto Lenz Gunsch
|
author = Augusto Lenz Gunsch
|
||||||
author_email = augustogunsch@tutanota.com
|
author_email = augustogunsch@tutanota.com
|
||||||
description = CLI SubRip editor
|
description = CLI SubRip editor
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import fsub.fsub as fsub
|
import fsub
|
||||||
|
|
||||||
|
|
||||||
# External interface
|
# External interface
|
||||||
def run(*args):
|
def run(args):
|
||||||
fsub.run(args)
|
fsub.run(args)
|
||||||
|
|
|
@ -303,7 +303,7 @@ class SubripFile:
|
||||||
|
|
||||||
self.subs = new_subs
|
self.subs = new_subs
|
||||||
|
|
||||||
self.write_file(in_place=args.replace, stdout=args.stdout)
|
self.write_file(args.replace)
|
||||||
|
|
||||||
def write_file(self, in_place=False, stdout=False):
|
def write_file(self, in_place=False, stdout=False):
|
||||||
self.renumber()
|
self.renumber()
|
||||||
|
@ -456,18 +456,16 @@ def parse_args(args):
|
||||||
# Flags that require section
|
# Flags that require section
|
||||||
if args.cut_out:
|
if args.cut_out:
|
||||||
if not args.begin and not args.end:
|
if not args.begin and not args.end:
|
||||||
parser.print_usage(file=sys.stderr)
|
panic('You must specify a section to work with', 64)
|
||||||
panic('fsub: error: You must specify a section to work with', 64)
|
|
||||||
|
|
||||||
# Validate options
|
|
||||||
if not args.clean and args.config:
|
|
||||||
parser.print_usage(file=sys.stderr)
|
|
||||||
panic('fsub: error: --config requires --clean', 64)
|
|
||||||
|
|
||||||
# Make sure --clean is the default
|
# Make sure --clean is the default
|
||||||
if not any((args.shift, args.no_html, args.join, args.cut_out)):
|
if not any((args.shift, args.no_html, args.join, args.cut_out)):
|
||||||
args.clean = True
|
args.clean = True
|
||||||
|
|
||||||
|
# Validate options
|
||||||
|
if not args.clean and args.config:
|
||||||
|
panic('-f requires -c', 64)
|
||||||
|
|
||||||
if args.begin:
|
if args.begin:
|
||||||
args.begin = SectionMarker(args.begin)
|
args.begin = SectionMarker(args.begin)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue