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):
704704 rv = SymOp (R , t )
705705 return rv
706706
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-
736707def getParser (eps = None ):
737708 """Return new parser object for CIF structure format.
738709
Original file line number Diff line number Diff line change 2222
2323from diffpy .structure .tests .testutils import datafile
2424from diffpy .structure .parsers .p_cif import P_cif , leading_float , getSymOp
25- from diffpy .structure .parsers .p_cif import _quoteLocalPath
2625from diffpy .structure .parsers import getParser
2726from diffpy .structure import Structure
2827from diffpy .structure import StructureFormatError
@@ -61,18 +60,6 @@ def test_getSymOp(self):
6160 self .assertEqual (str (op1_std ), str (op1 ))
6261 return
6362
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-
7663# End of class TestRoutines
7764
7865# ----------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments