Пример #1
0
 def check_user(path):
     if sys.platform != 'win32':
         in_path = '~'
         path = catalog.catalog_path(in_path)
         d,f = os.path.split(path)
         assert(d == os.path.expanduser(in_path))
         assert(f == catalog.os_dependent_catalog_name())
Пример #2
0
 def get_test_dir(self, erase=0):
     # make sure tempdir catalog doesn't exist
     pardir = tempfile.mkdtemp(suffix="cat_test")
     cat_glob = os.path.join(pardir, catalog.os_dependent_catalog_name() + ".*")
     cat_files = glob.glob(cat_glob)
     if erase:
         for cat_file in cat_files:
             os.remove(cat_file)
     return pardir
Пример #3
0
 def get_test_dir(self,erase=0):
     # make sure tempdir catalog doesn't exist
     pardir = tempfile.mkdtemp(suffix='cat_test')
     cat_glob = os.path.join(pardir,catalog.os_dependent_catalog_name()+'.*')
     cat_files = glob.glob(cat_glob)
     if erase:
         for cat_file in cat_files:
             os.remove(cat_file)
     return pardir
Пример #4
0
 def get_test_dir(self,erase = 0):
     # make sure tempdir catalog doesn't exist
     import tempfile, glob
     #temp = tempfile.gettempdir()
     pardir = tempfile.mktemp(suffix='cat_test')
     if not os.path.exists(pardir):
         os.mkdir(pardir)
     cat_glob = os.path.join(pardir,catalog.os_dependent_catalog_name()+'.*')
     cat_files = glob.glob(cat_glob)
     if erase:
         for cat_file in cat_files:
             os.remove(cat_file)
     return pardir
Пример #5
0
 def test_user(path):
     in_path = '~'
     path = catalog.catalog_path(in_path)
     d, f = os.path.split(path)
     assert_(d == os.path.expanduser(in_path))
     assert_(f == catalog.os_dependent_catalog_name())
Пример #6
0
 def test_current(self):
     in_path = '.'
     path = catalog.catalog_path(in_path)
     d, f = os.path.split(path)
     assert_(d == os.path.abspath(in_path))
     assert_(f == catalog.os_dependent_catalog_name())
Пример #7
0
 def test_default(self):
     in_path = catalog.default_dir()
     path = catalog.catalog_path(in_path)
     d, f = os.path.split(path)
     assert_(d == in_path)
     assert_(f == catalog.os_dependent_catalog_name())
Пример #8
0
 def check_current(self):
     in_path = '.'
     path = catalog.catalog_path(in_path)
     d,f = os.path.split(path)
     assert(d == os.path.abspath(in_path))
     assert(f == catalog.os_dependent_catalog_name())
Пример #9
0
 def check_default(self):
     in_path = catalog.default_dir()
     path = catalog.catalog_path(in_path)
     d,f = os.path.split(path)
     assert(d == in_path)
     assert(f == catalog.os_dependent_catalog_name())
Пример #10
0
 def test_user(path):
     in_path = "~"
     path = catalog.catalog_path(in_path)
     d, f = os.path.split(path)
     assert_(d == os.path.expanduser(in_path))
     assert_(f == catalog.os_dependent_catalog_name())
Пример #11
0
 def test_current(self):
     in_path = "."
     path = catalog.catalog_path(in_path)
     d, f = os.path.split(path)
     assert_(d == os.path.abspath(in_path))
     assert_(f == catalog.os_dependent_catalog_name())
Пример #12
0
def temp_catalog_files(prefix=''):
    # might need to add some more platform specific catalog file
    # suffixes to remove.  The .pag was recently added for SunOS
    d = catalog.default_dir()
    f = catalog.os_dependent_catalog_name()
    return glob.glob(os.path.join(d,prefix+f+'*'))
Пример #13
0
def temp_catalog_files(prefix=''):
    # might need to add some more platform specific catalog file
    # suffixes to remove.  The .pag was recently added for SunOS
    d = catalog.default_dir()
    f = catalog.os_dependent_catalog_name()
    return glob.glob(os.path.join(d,prefix+f+'*'))