lyx_mirror/lib/scripts/date.py
Richard Heck f9de88c53c Remove the shebang line from our python scripts, per Jose's suggestion.
Fedora ships these chmod 644 and has never seen a problem. The advantage
to doing this is that it better controls what version of python we are
using to launch the script, and it will reveal if we're somehow somewhere
not controlling that properly.
2014-01-28 12:52:16 -05:00

33 lines
787 B
Python
Executable File

# -*- 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)