fix ponysay-tool installation

Signed-off-by: Mattias Andrée <maandree@operamail.com>
This commit is contained in:
Mattias Andrée 2013-04-04 14:14:09 +02:00
parent 7bbc0a0266
commit 298679fecf
3 changed files with 65 additions and 74 deletions

View file

@ -558,17 +558,17 @@ class Setup():
if hasponies and os.path.isdir(sharedir):
for toolcommand in ('--dimensions', '--metadata'):
if not self.free:
print('%s, %s, %s' % ('./src/ponysay-tool.py', toolcommand, sharedir))
Popen(['./src/ponysay-tool.py', toolcommand, sharedir], stdin=PIPE, stdout=PIPE, stderr=PIPE).communicate()
print('%s, %s, %s' % ('./src/ponysaytool.py', toolcommand, sharedir))
Popen(['./src/ponysaytool.py', toolcommand, sharedir], stdin=PIPE, stdout=PIPE, stderr=PIPE).communicate()
else:
params = ['./src/ponysay-tool.py', toolcommand, sharedir, '--']
params = ['./src/ponysaytool.py', toolcommand, sharedir, '--']
for sharefile in os.listdir(sharedir):
if sharefile.endswith('.pony') and (sharefile != '.pony'):
if not Setup.validateFreedom(sharedir + '/' + sharefile):
print('Skipping metadata correction for %s/%s, did not pass validation process made by setup settings' % (sharedir, sharefile))
else:
params.append(sharefile)
print('%s, %s, %s (with files)' % ('./src/ponysay-tool.py', toolcommand, sharedir))
print('%s, %s, %s (with files)' % ('./src/ponysaytool.py', toolcommand, sharedir))
Popen(params, stdin=PIPE, stdout=PIPE, stderr=PIPE).communicate()
print()

View file

@ -56,8 +56,7 @@ if __name__ == '__main__':
istool = istool[:istool.find(os.extsep)]
istool = istool.endswith('-tool')
if istool:
from ponysaytool import *
startponysaytool()
from ponysaytool import * ## will start ponysay-tool
exit(0)
isthink = sys.argv[0]

View file

@ -1183,10 +1183,6 @@ class TextArea(): # TODO support small screens
'''
Start the program
'''
def startponysaytool():
'''
The user's home directory
'''
@ -1252,7 +1248,3 @@ def startponysaytool():
PonysayTool(args = opts)
if __name__ == '__main__':
startponysaytool()