mirror of
https://github.com/erkin/ponysay
synced 2024-11-15 16:07:59 +00:00
kms fix (however not working because of some bug in util-say)
This commit is contained in:
parent
924a2ab8ed
commit
5dde586850
2 changed files with 13 additions and 4 deletions
4
configure
vendored
4
configure
vendored
|
@ -223,6 +223,9 @@ function makeMakefile()
|
|||
echo 'install "'"$file"'" "$(INSTALLDIR)/share/licenses/ponysay/'"$file"'"'
|
||||
done
|
||||
echo
|
||||
echo -en '\t' ; echo 'mkdir -p $(DESTDIR)/var/cache/ponysay/'
|
||||
echo -en '\t' ; echo 'chmod 777 $(DESTDIR)/var/cache/ponysay/'
|
||||
echo
|
||||
|
||||
for completion in $completions; do
|
||||
shell="${completion##*/}"
|
||||
|
@ -286,6 +289,7 @@ EOF
|
|||
echo
|
||||
|
||||
echo 'uninstall:'
|
||||
echo -en '\t' ; echo 'if [ -d "$(DESTDIR)/var/cache/ponysay" ]; then rm -rf "$(INSTALLDIR)/var/cache/ponysay"; fi'
|
||||
for old in $installedDirs; do
|
||||
echo -en '\t'
|
||||
echo 'if [ -d "$(INSTALLDIR)/'"$old"'" ]; then rm -rf "$(INSTALLDIR)/'"$old"'"; fi'
|
||||
|
|
13
ponysay.py
13
ponysay.py
|
@ -491,23 +491,28 @@ class Ponysay():
|
|||
palettefile = env_kms.replace('\033]P', '')
|
||||
|
||||
kmsponies = '/var/cache/ponysay/kmsponies/' + palettefile
|
||||
kmspony = kmsponies + pony
|
||||
kmspony = (kmsponies + pony).replace('//', '/')
|
||||
|
||||
if not os.path.isfile(kmspony):
|
||||
protokmsponies = '/var/cache/ponysay/protokmsponies/'
|
||||
protokmspony = protokmsponies + pony
|
||||
protokmspony = (protokmsponies + pony).replace('//', '/')
|
||||
|
||||
protokmsponydir = protokmspony[:protokmspony.rindex('/')]
|
||||
kmsponydir = kmspony[: kmspony.rindex('/')]
|
||||
|
||||
_protokmspony = '\'' + protokmspony.replace('\'', '\'\\\'\'') + '\''
|
||||
_kmspony = '\'' + kmspony.replace('\'', '\'\\\'\'') + '\''
|
||||
_pony = '\'' + pony.replace('\'', '\'\\\'\'') + '\''
|
||||
|
||||
if not os.path.isfile(protokmspony):
|
||||
os.makedirs(protokmsponies)
|
||||
if not os.path.isdir(protokmsponydir):
|
||||
os.makedirs(protokmsponydir)
|
||||
if not os.system('ponysay2ttyponysay < ' + _pony + ' > ' + _protokmspony) == 0:
|
||||
sys.stderr.write('Unable to run ponysay2ttyponysay successfully, you need util-say for KMS support\n')
|
||||
exit(1)
|
||||
|
||||
os.makedirs(kmsponies)
|
||||
if not os.path.isdir(kmsponydir):
|
||||
os.makedirs(kmsponydir)
|
||||
if not os.system('tty2colourfultty -e -p ' + palette + ' < ' + _protokmspony + ' > ' + _kmspony) == 0:
|
||||
sys.stderr.write('Unable to run tty2colourfultty successfully, you need util-say for KMS support\n')
|
||||
exit(1)
|
||||
|
|
Loading…
Reference in a new issue