예제 #1
0
 def _create(self, obj, **kwargs):
     """Override `ObjectStore`'s stub by creating any files and folders on disk."""
     if not self._exists(obj, **kwargs):
         path = self._construct_path(obj, **kwargs)
         dir_only = kwargs.get('dir_only', False)
         # Create directory if it does not exist
         dir = path if dir_only else os.path.dirname(path)
         safe_makedirs(dir)
         # Create the file if it does not exist
         if not dir_only:
             open(path, 'w').close()  # Should be rb?
             umask_fix_perms(path, self.config.umask, 0o666)
예제 #2
0
파일: __init__.py 프로젝트: msauria/galaxy
 def create(self, obj, **kwargs):
     """Override `ObjectStore`'s stub by creating any files and folders on disk."""
     if not self.exists(obj, **kwargs):
         path = self._construct_path(obj, **kwargs)
         dir_only = kwargs.get('dir_only', False)
         # Create directory if it does not exist
         dir = path if dir_only else os.path.dirname(path)
         safe_makedirs(dir)
         # Create the file if it does not exist
         if not dir_only:
             open(path, 'w').close()  # Should be rb?
             umask_fix_perms(path, self.config.umask, 0o666)