# -*- coding: utf-8 -*-
"""
Created on %(date)s
Creator: yourname
"""
from logging import debug as LD
from logging import info as LI
import logging as log
log.basicConfig(level=log.DEBUG,
format='%(levelname)s|%(funcName)s|line:%(lineno)d - %(message)s')
log.disable(log.DEBUG)
#log.disable(log.CRITICAL)
# -*- coding: utf-8 -*-
"""
Created on %(date)s
Creator: yourname
"""
from logging import debug as LD
from logging import info as LI
import logging as log
log.basicConfig(level=log.DEBUG,
format='%(levelname)s|%(funcName)s|line:%(lineno)d - %(message)s')
log.disable(log.DEBUG)
#log.disable(log.CRITICAL)
# -*- coding: utf-8 -*-
"""
Created on 2018-2-4
Creator: yourname
"""
from logging import debug as LD
from logging import info as LI
import logging as log
log.basicConfig(level=log.DEBUG,
format='%(levelname)s|%(funcName)s|line:%(lineno)d - %(message)s')
log.disable(log.DEBUG)
#log.disable(log.CRITICAL)
format='%(levelname)s|%(funcName)s|line:%(lineno)d - %(message)s')
if text is None:
default_content = True
text, enc = encoding.read(self.TEMPLATE_PATH)
enc_match = re.search('-*- coding: ?([a-z0-9A-Z\-]*) -*-', text)
annotation_match = re.search('"""(?:(?!""").|[\n\r])*"""', text)
if enc_match:
enc = enc_match.group(1)
# Initialize template variables
# Windows
username = encoding.to_unicode_from_fs(os.environ.get('USERNAME',
''))
# Linux, Mac OS X
if not username:
username = encoding.to_unicode_from_fs(os.environ.get('USER',
'-'))
VARS = {
'date': time.strftime("%Y-%m-%d %H:%M"),
'username': username,
}
try:
#text = text % VARS
text = re.sub('"""(?:(?!""").|[\n\r])*"""',
annotation_match[0] % VARS,
text,
count=1)
except:
pass
does anyone know how to change the date format in template.py to ,say, 2018-07-11 22:22:22?
@Hailprob It looks like it's hard coded in editor.py so you would have to change spyder code:
is this going to be added to the next version of spyder?
No.
Most helpful comment
is this going to be added to the next version of spyder?