LEFT | RIGHT |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright: 2013 MoinMoin:RogerHaase | 2 # Copyright: 2013 MoinMoin:RogerHaase |
3 # License: GNU GPL v2 (or any later version), see LICENSE.txt for details. | 3 # License: GNU GPL v2 (or any later version), see LICENSE.txt for details. |
4 | 4 |
5 """ | 5 """ |
6 make.py provides a menu of commands frequently used by moin2 developers and desk
top wiki users. | 6 make.py provides a menu of commands frequently used by moin2 developers and desk
top wiki users. |
7 | 7 |
8 - wraps a few commonly used moin commands, do "moin --help" for other altern
atives | 8 - wraps a few commonly used moin commands, do "moin --help" for other altern
atives |
9 - adds default file names for selected moin commands (backup, restore, ...) | 9 - adds default file names for selected moin commands (backup, restore, ...) |
10 - creates log files for functions with large output, extracts success/failur
e messages | 10 - creates log files for functions with large output, extracts success/failur
e messages |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 print 'Success: Basic theme CSS files updated.' | 389 print 'Success: Basic theme CSS files updated.' |
390 else: | 390 else: |
391 print 'Error: Basic theme CSS files update failed, see error message
s above.' | 391 print 'Error: Basic theme CSS files update failed, see error message
s above.' |
392 | 392 |
393 result = subprocess.call(command_modernized, shell=True) | 393 result = subprocess.call(command_modernized, shell=True) |
394 if result == 0: | 394 if result == 0: |
395 print 'Success: Modernized theme CSS files updated.' | 395 print 'Success: Modernized theme CSS files updated.' |
396 else: | 396 else: |
397 print 'Error: Modernized theme CSS files update failed, see error me
ssages above.' | 397 print 'Error: Modernized theme CSS files update failed, see error me
ssages above.' |
398 | 398 |
399 | |
400 def cmd_tests(self, *args): | 399 def cmd_tests(self, *args): |
401 """run tests, output goes to pytest.txt and pytestpep8.txt""" | 400 """run tests, output goes to pytest.txt and pytestpep8.txt""" |
402 print 'Running tests... output written to {0}.'.format(PYTEST) | 401 print 'Running tests... output written to {0}.'.format(PYTEST) |
403 command = '{0}py.test --pep8 > {1} {2} 2>&1'.format(ACTIVATE, PYTEST, '
'.join(args)) | 402 command = '{0}py.test --pep8 > {1} {2} 2>&1'.format(ACTIVATE, PYTEST, '
'.join(args)) |
404 result = subprocess.call(command, shell=True) | 403 result = subprocess.call(command, shell=True) |
405 print 'Summary message from {0} is shown below. Do "{1} log pytest" to s
ee complete log.'.format(PYTEST, M) | 404 print 'Summary message from {0} is shown below. Do "{1} log pytest" to s
ee complete log.'.format(PYTEST, M) |
406 search_for_phrase(PYTEST) | 405 search_for_phrase(PYTEST) |
407 | 406 |
408 def cmd_coding_std(self, *args): | 407 def cmd_coding_std(self, *args): |
409 """correct scripts that taint the HG repository and clutter subsequent c
ode reviews""" | 408 """correct scripts that taint the HG repository and clutter subsequent c
ode reviews""" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 print 'Error: files created by quickinstall are missing, run "%s qui
ckinstall" and try again.' % M | 487 print 'Error: files created by quickinstall are missing, run "%s qui
ckinstall" and try again.' % M |
489 else: | 488 else: |
490 choice = 'cmd_%s' % sys.argv[1] | 489 choice = 'cmd_%s' % sys.argv[1] |
491 choice = choice.replace('-', '_') | 490 choice = choice.replace('-', '_') |
492 if choice in choices: | 491 if choice in choices: |
493 choice = getattr(commands, choice) | 492 choice = getattr(commands, choice) |
494 choice(*sys.argv[2:]) | 493 choice(*sys.argv[2:]) |
495 else: | 494 else: |
496 print help | 495 print help |
497 print 'Error: unknown menu selection "%s"' % sys.argv[1] | 496 print 'Error: unknown menu selection "%s"' % sys.argv[1] |
LEFT | RIGHT |