1687 ) |
1687 ) |
1688 modname = module |
1688 modname = module |
1689 isRemoteFileName = FileSystemUtilities.isRemoteFileName(module) |
1689 isRemoteFileName = FileSystemUtilities.isRemoteFileName(module) |
1690 |
1690 |
1691 if isRemoteFileName: |
1691 if isRemoteFileName: |
1692 module, extension = os.path.splitext(os.path.basename(module)) |
1692 fsInterface = ericApp().getObject("EricServer").getServiceInterface("FileSystem") |
|
1693 module, extension = fsInterface.splitext(fsInterface.basename(module)) |
1693 else: |
1694 else: |
1694 with contextlib.suppress(ValueError): |
1695 with contextlib.suppress(ValueError): |
1695 _extensions.remove(".py") |
1696 _extensions.remove(".py") |
1696 |
1697 |
1697 if os.path.exists(module): |
1698 if os.path.exists(module): |
1730 if caching: |
1731 if caching: |
1731 _modules[modname] = mod |
1732 _modules[modname] = mod |
1732 return mod |
1733 return mod |
1733 |
1734 |
1734 if isRemoteFileName: |
1735 if isRemoteFileName: |
1735 if ( |
1736 if not fsInterface.exists(modname): |
1736 not ericApp() |
|
1737 .getObject("EricServer") |
|
1738 .getServiceInterface("FileSystem") |
|
1739 .exists(modname) |
|
1740 ): |
|
1741 raise ImportError |
1737 raise ImportError |
|
1738 |
1742 if extension == ".ptl": |
1739 if extension == ".ptl": |
1743 moduleType = PTL_SOURCE |
1740 moduleType = PTL_SOURCE |
1744 elif extension == ".rb": |
1741 elif extension == ".rb": |
1745 moduleType = RB_SOURCE |
1742 moduleType = RB_SOURCE |
1746 elif extension in _extensions: |
1743 elif extension in _extensions: |