| |
@@ -38,7 +38,7 @@
|
| |
try:
|
| |
import globalvar
|
| |
except ImportError:
|
| |
- print "globalvar.py is missing. It is needed as it provides release specific variables"
|
| |
+ print ("globalvar.py is missing. It is needed as it provides release specific variables")
|
| |
raise
|
| |
|
| |
# Import websites specific modules, used to create specific
|
| |
@@ -134,22 +134,23 @@
|
| |
process_dir(dirpath, filenames)
|
| |
except:
|
| |
if options.keepgoing:
|
| |
- print 'Error!'
|
| |
+ print ('Error!')
|
| |
else:
|
| |
raise
|
| |
if HAVE_TIMING:
|
| |
timing.finish()
|
| |
if not options.rss and HAVE_TIMING:
|
| |
- print 'Website build time: %s' % timing.milli()
|
| |
+ print (f'Website build time: {timing.milli()}')
|
| |
|
| |
def process_dir(dirpath, filenames):
|
| |
'''
|
| |
Process a directory
|
| |
'''
|
| |
if options.podir and options.lang:
|
| |
- translations = GNUTranslations(open(os.path.join(options.podir, options.lang + '.mo')))
|
| |
+ translations = GNUTranslations(open(os.path.join(options.podir, options.lang + '.mo'),"rb"))
|
| |
+
|
| |
if int(get_distribution('genshi').version[2]) < 6:
|
| |
- loader = TemplateLoader(['.'], callback=lambda template: template.filters.insert(0, Translator(translations.ugettext)))
|
| |
+ loader = TemplateLoader(['.'], callback=lambda template: template.filters.insert(0, Translator(translations.gettext)))
|
| |
else:
|
| |
loader = TemplateLoader(['.'], callback=lambda template: template.filters.insert(0, Translator(translations)))
|
| |
for fn in filenames:
|
| |
@@ -202,7 +203,7 @@
|
| |
'atomic_vagrant_virtualbox', 'atomic_iso']
|
| |
with open(os.path.join(options.output, ".htaccess"), 'a') as htaccess_f:
|
| |
for artifact in artifacts_redirect:
|
| |
- if artifact is 'atomic_iso':
|
| |
+ if artifact == 'atomic_iso':
|
| |
htaccess_f.write('Redirect 302 "/{}_latest"'
|
| |
' "/atomic_dvd_ostree_x86_64_latest"\n'.format(artifact))
|
| |
htaccess_f.write('Redirect 302 "/{}_latest_filename"'
|
| |
@@ -239,7 +240,7 @@
|
| |
template = loader.load(src_file)
|
| |
# Variables made availble to all templates
|
| |
page = template.generate(
|
| |
- _=lambda text: translations.ugettext(text),
|
| |
+ _=lambda text: translations.gettext(text),
|
| |
feedparse=feedparse,
|
| |
lang=options.lang,
|
| |
relpath=relpath,
|
| |
@@ -249,7 +250,7 @@
|
| |
schedule = release_date,
|
| |
ec2_ami = ec2,
|
| |
iot_links = iot_compose_links
|
| |
- ).render(method='html', doctype='html', encoding='utf-8')
|
| |
+ ).render(method='html', doctype='html')
|
| |
output = open(dest_file, 'w')
|
| |
output.write(page)
|
| |
output.close()
|
| |
do not merge