Commit 01e3f33 1 parent c169eaa commit 01e3f33 Copy full SHA for 01e3f33
File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 1
1
from FrictionlessDarwinCore import *
2
+ from pathlib import Path
3
+
2
4
import sys
3
5
import shutil
4
6
import requests
5
7
import zipfile
6
8
import tempfile
7
9
8
10
11
+
9
12
class DwCArchive :
10
13
voc = DwCVocabulary ()
11
14
@@ -46,10 +49,10 @@ def load(self):
46
49
zf = zipfile .ZipFile (self .path , mode = 'r' )
47
50
try :
48
51
for info in zf .infolist ():
49
- fname = info .filename . rsplit ( "/" , 1 )[ 1 ]
50
- if fname in ('eml.xml' ,'metadata.xml' ):
52
+ p = Path ( info .filename )
53
+ if p . name in ('eml.xml' ,'metadata.xml' ):
51
54
eml = zf .read (info .filename ).decode ()
52
- if fname == 'meta.xml' :
55
+ if p . name == 'meta.xml' :
53
56
meta = zf .read (info .filename ).decode ()
54
57
if eml != '' and meta != '' :
55
58
self .metadata = DwCMetadata (eml )
You can’t perform that action at this time.
0 commit comments