just polishing

This commit is contained in:
q
2018-10-01 21:29:24 +03:00
parent f678da2330
commit f71ccbd3c3
2 changed files with 11 additions and 6 deletions

View File

@@ -45,7 +45,6 @@ class getch:
class EndProgram( Exception ): class EndProgram( Exception ):
''' Nice exit ''' ''' Nice exit '''
print('')
pass pass
class slide_reader: class slide_reader:
@@ -601,6 +600,7 @@ def cut_line(s,i):
re.sub("\$\{.$","", re.sub("\$\{.$","",
s))) s)))
return s return s
def add_highlight(s,opts): def add_highlight(s,opts):
""" Add cursor position highlight """ """ Add cursor position highlight """
if len(s.strip())==0: if len(s.strip())==0:
@@ -706,7 +706,10 @@ def modify_file(reader,offset):
) )
def take_screenshot(reader,opts): def take_screenshot(reader,opts):
out_file=os.path.join(opts.screenshots,"slide%03d.png"%(reader.page+1)) out_file = os.path.join(
opts.screenshots,
"slide%03d.png"%(reader.page + 1,)
)
if not os.path.exists(opts.screenshots): if not os.path.exists(opts.screenshots):
os.mkdir(opts.screenshots) os.mkdir(opts.screenshots)
subprocess.call( subprocess.call(
@@ -722,8 +725,6 @@ def get_open_command():
else: else:
return "xdg-open" return "xdg-open"
def main(): def main():
global bc global bc
global getch global getch
@@ -732,9 +733,13 @@ def main():
getch = getch() getch = getch()
opts = setup_options() opts = setup_options()
browser(opts,opts.files) browser(
opts,
opts.files
)
print("\n\n")
if opts.screenshots: if opts.screenshots:
print("\n\nCrop the images for terminal tabs, and PDFize e.g.:\n- mogrify -chop 0x50 %s/*png\n- convert %s/*png %s.pdf"%( print("Crop the images for terminal tabs, and PDFize e.g.:\n- mogrify -chop 0x50 %s/*png\n- convert %s/*png %s.pdf"%(
opts.screenshots, opts.screenshots,
opts.screenshots, opts.screenshots,
os.path.basename(opts.screenshots), os.path.basename(opts.screenshots),

Binary file not shown.