mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-27 14:29:21 +00:00
1b21743511
* src/insets/ExternalSupport.C (updateExternal): Avoid computing crc of a directory as this leads to a crash on Cygwin. * lib/configure.py: Use a python script to get the current date in order to avoid a stalling condition with the date command on Win32. * lib/scripts/date.py: New python script. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17168 a592a061-630c-0410-9148-cb99ea01b6c8
34 lines
809 B
Python
Executable File
34 lines
809 B
Python
Executable File
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# file date.py
|
|
# This file is part of LyX, the document processor.
|
|
# Licence details can be found in the file COPYING.
|
|
|
|
# \author Enrico Forestieri
|
|
|
|
# Full author contact details are available in file CREDITS.
|
|
|
|
# Print the system date and time in the given format. See the python
|
|
# documentation for available formats (mostly the same as the POSIX std).
|
|
# This file is provided because the date command on Windows is not
|
|
# POSIX compliant.
|
|
|
|
import sys
|
|
from time import strftime
|
|
|
|
def main(argv):
|
|
if len(argv) > 2:
|
|
sys.stderr.write('Usage: python date.py [<format>]\n')
|
|
sys.exit(1)
|
|
|
|
if len(argv) == 2:
|
|
format = argv[1]
|
|
else:
|
|
format = "%d-%m-%Y"
|
|
|
|
print strftime(format)
|
|
|
|
if __name__ == "__main__":
|
|
main(sys.argv)
|