
    h                     &    d Z ddlmZ d Zd Zd Zy)z
This function is snatched from
https://github.com/ojii/django-load/blob/3058ab9d9d4875589638cc45e84b59e7e1d7c9c3/django_load/core.py#L49
local changes:

* added check for basestring to allow values that are already an object
  or method.

    )import_modulec                     t        | t              s| S d| vrt        d      | j                  dd      \  }}t	        |      }t        ||      S )a  
    Loads an object from an 'import_path', like in MIDDLEWARE_CLASSES and the
    likes.

    Import paths should be: "mypackage.mymodule.MyObject". It then imports the
    module up until the last dot and tries to get the attribute after that dot
    from the imported module.

    If the import path does not contain any dots, a TypeError is raised.

    If the module cannot be imported, an ImportError is raised.

    If the attribute does not exist in the module, a AttributeError is raised.
    .zW'import_path' argument to 'django_load.core.load_object' must contain at least one dot.   )
isinstancestr	TypeErrorrsplitr   getattr)import_pathmodule_nameobject_namemodules       B/home/dcms/DCMS/lib/python3.12/site-packages/filer/utils/loader.pyload_objectr      s^     k3'
+() 	)  +11#q9K;'F6;''    c                 N    ddl m} | j                  d      } |j                  | S )Nr   )appsr   )django.appsr   split	get_model)
model_namer   model_name_tuples      r   
load_modelr   (   s(     !'',4>>+,,r   c                      | ||      S )a*  
    This factory returns an instance of the storage class provided.
    args:

    * klass: must be inherit from ``django.core.files.storage.Storage``
    * location: is a string representing the PATH similar to MEDIA_ROOT
    * base_url: is a string representing the URL similar to MEDIA_URL
    )locationbase_url )klassr   r   s      r   storage_factoryr    /   s     (X66r   N)__doc__	importlibr   r   r   r    r   r   r   <module>r#      s    $(4-	7r   