File tree Expand file tree Collapse file tree 2 files changed +0
-42
lines changed Expand file tree Collapse file tree 2 files changed +0
-42
lines changed Original file line number Diff line number Diff line change @@ -704,35 +704,6 @@ def getSymOp(s):
704
704
rv = SymOp (R , t )
705
705
return rv
706
706
707
-
708
- def _quoteLocalPath (filename ):
709
- """Quote local paths to file URL-s.
710
-
711
- CifFile reads files with urlopen, which fails for Windows paths or
712
- for paths containing ":".
713
-
714
- Parameters
715
- ----------
716
- filename : str
717
- The path to be corrected.
718
-
719
- Returns
720
- -------
721
- str
722
- The fixed URL when it contains ":" or `filename`.
723
- Return filename if it forms http or ftp URL.
724
- """
725
- rv = filename
726
- cnvflag = False
727
- if ':' in filename :
728
- head = filename .split (':' , 1 )[0 ].lower ()
729
- cnvflag = head .isalpha () and head not in ('http' , 'https' , 'ftp' )
730
- if cnvflag :
731
- from six .moves .urllib .request import pathname2url
732
- rv = pathname2url (filename )
733
- return rv
734
-
735
-
736
707
def getParser (eps = None ):
737
708
"""Return new parser object for CIF structure format.
738
709
Original file line number Diff line number Diff line change 22
22
23
23
from diffpy .structure .tests .testutils import datafile
24
24
from diffpy .structure .parsers .p_cif import P_cif , leading_float , getSymOp
25
- from diffpy .structure .parsers .p_cif import _quoteLocalPath
26
25
from diffpy .structure .parsers import getParser
27
26
from diffpy .structure import Structure
28
27
from diffpy .structure import StructureFormatError
@@ -61,18 +60,6 @@ def test_getSymOp(self):
61
60
self .assertEqual (str (op1_std ), str (op1 ))
62
61
return
63
62
64
-
65
- def test__quoteLocalPath (self ):
66
- "check _quoteLocalPath()"
67
- from six .moves .urllib .request import pathname2url as p2u
68
- self .assertEqual ('/a/b/c.cif' , _quoteLocalPath ('/a/b/c.cif' ))
69
- self .assertEqual (p2u ('c:\\ a.cif' ), _quoteLocalPath ('c:\\ a.cif' ))
70
- self .assertEqual (p2u ('c:/a.cif' ), _quoteLocalPath ('c:/a.cif' ))
71
- self .assertEqual ('/x:y/c.cif' , _quoteLocalPath ('/x:y/c.cif' ))
72
- self .assertEqual ('http::cif.org/a.cif' ,
73
- _quoteLocalPath ('http::cif.org/a.cif' ))
74
- return
75
-
76
63
# End of class TestRoutines
77
64
78
65
# ----------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments