mirror of
https://github.com/erkin/ponysay
synced 2024-11-16 08:27:58 +00:00
fix for gist 4026804
This commit is contained in:
parent
b92df4de1e
commit
d14f4547b8
1 changed files with 5 additions and 2 deletions
|
@ -136,7 +136,7 @@ class Ponysay():
|
|||
## Change system enviroment variables with ponysayrc
|
||||
for file in ('$XDG_CONFIG_HOME/ponysay/ponysayrc', '$HOME/.config/ponysay/ponysayrc', '$HOME/.ponysayrc', '/etc/ponysayrc'):
|
||||
file = parsefile(file)
|
||||
if os.path.exists(file):
|
||||
if (file is not None) and os.path.exists(file):
|
||||
with open(file, 'rb') as ponysayrc:
|
||||
code = ponysayrc.read().decode('utf8', 'replace') + '\n'
|
||||
env = os.environ
|
||||
|
@ -1846,7 +1846,10 @@ class Backend():
|
|||
|
||||
if self.pony.startswith('$$$\n'):
|
||||
self.pony = self.pony[4:]
|
||||
infoend = self.pony.index('\n$$$\n')
|
||||
if self.pony.startswith('$$$\n'):
|
||||
infoend = 0
|
||||
else:
|
||||
infoend = self.pony.index('\n$$$\n')
|
||||
info = self.pony[:infoend]
|
||||
if self.infolevel == 2:
|
||||
self.message = Backend.formatInfo(info)
|
||||
|
|
Loading…
Reference in a new issue