py3: use s.replace instead of string.replace (#46576)
This commit is contained in:
parent
3fa9c2c770
commit
f5896c55d4
|
@ -18,7 +18,6 @@ import requests
|
|||
from datetime import datetime
|
||||
import logging
|
||||
import re
|
||||
import string
|
||||
|
||||
from django.views.generic import DetailView as GenericDetailView
|
||||
from django.utils.decorators import method_decorator
|
||||
|
@ -147,9 +146,9 @@ class ResourceView(DetailView):
|
|||
m = regexp_filename_search_pattern_in_label.match(field['label'])
|
||||
if m:
|
||||
value['filename_original'] = value['filename']
|
||||
value['filename'] = string.replace(filename_result_pattern, 'searchedPatternInLabel', m.group(1))
|
||||
value['filename'] = filename_result_pattern.replace('searchedPatternInLabel', m.group(1))
|
||||
if 'filename' in filename_result_pattern:
|
||||
value['filename'] = string.replace(value['filename'], 'filename', value['filename_original'])
|
||||
value['filename'] = value['filename'].replace('filename', value['filename_original'])
|
||||
attachments.append(value)
|
||||
value = '%s' % value['filename']
|
||||
elif field['type'] == 'date':
|
||||
|
@ -415,9 +414,9 @@ class AttachmentView(DetailView):
|
|||
m = regexp_filename_search_pattern_in_label.match(field['label'])
|
||||
if m:
|
||||
value['filename_original'] = value['filename']
|
||||
value['filename'] = string.replace(filename_result_pattern, 'searchedPatternInLabel', m.group(1))
|
||||
value['filename'] = filename_result_pattern.replace('searchedPatternInLabel', m.group(1))
|
||||
if 'filename' in filename_result_pattern:
|
||||
value['filename'] = string.replace(value['filename'], 'filename', value['filename_original'])
|
||||
value['filename'] = value['filename'].replace('filename', value['filename_original'])
|
||||
attachments.append(value)
|
||||
#
|
||||
# get other Maarch variables (letterbox configuration by default)
|
||||
|
@ -548,10 +547,10 @@ class DebugView(DetailView):
|
|||
m = regexp_filename_search_pattern_in_label.match(field['label'])
|
||||
if m:
|
||||
value['filename_original'] = value['filename']
|
||||
value['filename'] = string.replace(filename_result_pattern, 'searchedPatternInLabel',
|
||||
value['filename'] = filename_result_pattern.replace('searchedPatternInLabel',
|
||||
m.group(1))
|
||||
if 'filename' in filename_result_pattern:
|
||||
value['filename'] = string.replace(value['filename'], 'filename',
|
||||
value['filename'] = value['filename'].replace('filename',
|
||||
value['filename_original'])
|
||||
attachments.append(value)
|
||||
value = '%s' % value['filename']
|
||||
|
|
Loading…
Reference in New Issue