File: expeyes-progman-jr-doc

package info (click to toggle)
expeyes-doc 4.3-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 20,916 kB
  • sloc: xml: 337; python: 193; makefile: 146
file content (24 lines) | stat: -rw-r--r-- 682 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#! /usr/bin/python

import sys, os, os.path
from subprocess import call

lang     = os.environ.get('LANG')
language = os.environ.get('LANGUAGE')
lc_all   = os.environ.get('LC_ALL')

preferred='en'
if language and language[0:2] != preferred:
    preferred=language[0:2]
elif lang and lang[0:2] != preferred:
    preferred=lang[0:2]
elif lc_all and lc_all[0:2] != preferred:
    preferred=lc_all[0:2]
if len(sys.argv)>1:
    preferred=sys.argv[1]

pdfTail='eyesj-progman.pdf'
filename=os.path.join('/usr/share/expeyes/doc', preferred+'-'+pdfTail)
if not os.path.exists(filename):
    filename=os.path.join('/usr/share/expeyes/doc', 'en-'+pdfTail)
call('evince '+filename, shell=True)