jasonrollins / shareplum

Pythonic SharePoint
MIT License
179 stars 96 forks source link

Add timeout argument to Folder #128

Open crossalchemist opened 3 years ago

crossalchemist commented 3 years ago

It would be beneficial to set a custom timeout when working with larger files.

The change would be to init in folder.py:

from .request_helper import get, post
import json

class _Folder():
    def __init__(self, session, folder_name, url, timeout):
        self._session = session
        self.folder_name = folder_name
        self.site_url = url
        self.timeout = timeout

        self.info = self._create_folder()

And to site.py:

def Folder(self, folder_name, timeout=3):
    """Sharepoint Folder Web Service
    """
    return _Folder(self._session, folder_name, self.site_url, timeout)
jasonrollins commented 3 years ago

This timeout would be for the session object?

On Thu, Oct 8, 2020 at 2:01 PM crossalchemist notifications@github.com wrote:

It would be beneficial to set a custom timeout when working with larger files.

The change would be to init in folder.py:

from .request_helper import get, postimport json

class _Folder(): def init(self, session, folder_name, url, timeout=3): self._session = session self.folder_name = folder_name self.site_url = url self.timeout = timeout

    self.info = self._create_folder()

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jasonrollins/shareplum/issues/128, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOVTVW44CNT744ZT762NBLSJYD67ANCNFSM4SJEKMEA .

crossalchemist commented 3 years ago

I'm not sure. By making these changes, and specifying a 30 second timeout, I was able to upload a 25 MB file.