Package: python-pbcore / 2.1.2+dfsg-5

seek-curdir-for-xml.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Description: Try looking for mapping.xml in the current directory 
 helps when package is not installed for generating docs etc
Origin: Nilesh Patra <nilesh@debian.org>
Last-Update: 2021-12-23
--- a/pbcore/chemistry/chemistry.py
+++ b/pbcore/chemistry/chemistry.py
@@ -34,8 +34,12 @@
 
 
 def _loadBarcodeMappings():
-    mappingFname = resource_filename(Requirement.parse(
+    try:
+        mappingFname = resource_filename(Requirement.parse(
         'pbcore'), 'pbcore/chemistry/resources/mapping.xml')
+    except:
+        mappingFname = os.path.join(os.path.dirname(__file__),
+        'resources/mapping.xml')
     mappings = _loadBarcodeMappingsFromFile(mappingFname)
     updMappingDir = os.getenv("SMRT_CHEMISTRY_BUNDLE_DIR")
     if updMappingDir: