Merge branch 'kovidgoyal:master' into master

This commit is contained in:
unkn0w7n 2023-05-25 10:05:45 +05:30 committed by GitHub
commit 74020eb2ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 3 deletions

View File

@ -207,9 +207,14 @@ else:
uchardet_libs = pkgconfig_libs('uchardet', '', '') uchardet_libs = pkgconfig_libs('uchardet', '', '')
if 'PODOFO_PREFIX' in os.environ:
os.environ['PODOFO_LIB_DIR'] = os.path.join(os.environ['PODOFO_PREFIX'], 'lib')
os.environ['PODOFO_INC_DIR'] = os.path.join(os.environ['PODOFO_PREFIX'], 'include', 'podofo')
os.environ['PODOFO_LIB_NAME'] = os.path.join(os.environ['PODOFO_PREFIX'], 'lib', 'libpodofo.so.1')
podofo_lib = os.environ.get('PODOFO_LIB_DIR', podofo_lib) podofo_lib = os.environ.get('PODOFO_LIB_DIR', podofo_lib)
podofo_inc = os.environ.get('PODOFO_INC_DIR', podofo_inc) podofo_inc = os.environ.get('PODOFO_INC_DIR', podofo_inc)
podofo = os.environ.get('PODOFO_LIB_NAME', 'podofo') podofo = os.environ.get('PODOFO_LIB_NAME', 'podofo')
podofo_error = None if os.path.exists(os.path.join(podofo_inc, 'podofo.h')) else \ podofo_error = None if os.path.exists(os.path.join(podofo_inc, 'podofo.h')) else \
('PoDoFo not found on your system. Various PDF related', ('PoDoFo not found on your system. Various PDF related',
' functionality will not work. Use the PODOFO_INC_DIR and', ' functionality will not work. Use the PODOFO_INC_DIR and',

View File

@ -77,7 +77,7 @@ class Check(Command):
def file_has_errors(self, f): def file_has_errors(self, f):
ext = os.path.splitext(f)[1] ext = os.path.splitext(f)[1]
if ext in {'.py', '.recipe'}: if ext in {'.py', '.recipe'}:
p2 = subprocess.Popen(['ruff', '--no-update-check', f]) p2 = subprocess.Popen(['ruff', 'check', f])
return p2.wait() != 0 return p2.wait() != 0
if ext == '.pyj': if ext == '.pyj':
p = subprocess.Popen(['rapydscript', 'lint', f]) p = subprocess.Popen(['rapydscript', 'lint', f])

View File

@ -822,11 +822,11 @@ class BuiltinIdentifierInList(BuiltinFormatterFunction):
raise ValueError(_("{} requires 2 or 4 arguments").format(self.name)) raise ValueError(_("{} requires 2 or 4 arguments").format(self.name))
l = [v.strip() for v in val.split(',') if v.strip()] l = [v.strip() for v in val.split(',') if v.strip()]
(id_, _, regexp) = ident.partition(':') (id_, __, regexp) = ident.partition(':')
if not id_: if not id_:
return nfv return nfv
for candidate in l: for candidate in l:
i, _, v = candidate.partition(':') i, __, v = candidate.partition(':')
if v and i == id_: if v and i == id_:
if not regexp or re.search(regexp, v, flags=re.I): if not regexp or re.search(regexp, v, flags=re.I):
return candidate if fv_is_id else fv return candidate if fv_is_id else fv

View File

@ -131,6 +131,7 @@ object_as_reference(const PdfObject *o) {
} }
// Needed to avoid PoDoFo clobbering the /Info and XMP metadata with its own nonsense // Needed to avoid PoDoFo clobbering the /Info and XMP metadata with its own nonsense
// rename to NoMetadataUdate after https://github.com/podofo/podofo/commit/96689eb6e45b71eae1577ecb2d4a796c52e9a813
static const PdfSaveOptions save_options = PdfSaveOptions::NoModifyDateUpdate; static const PdfSaveOptions save_options = PdfSaveOptions::NoModifyDateUpdate;
class PdfReferenceHasher { class PdfReferenceHasher {