@@ -121,8 +121,7 @@ def delete_all_user_projects(session, user=None):
121121
122122
123123def delete_project (session , guid , user = None ):
124- """Delete a single project. Simply pass in the guid
125- """
124+ """Delete a single project. Simply pass in the guid"""
126125 if not user :
127126 user = current_user (session )
128127 nodes_url = user .relationships .nodes ['links' ]['related' ]['href' ]
@@ -135,8 +134,7 @@ def delete_project(session, guid, user=None):
135134
136135
137136def create_custom_collection (session ):
138- """Create a new custom collection. You can modify the title of the collection here as well.
139- """
137+ """Create a new custom collection. You can modify the title of the collection here as well."""
140138 collections_url = '{}/v2/collections/' .format (session .api_base_url )
141139
142140 payload = {
@@ -147,8 +145,7 @@ def create_custom_collection(session):
147145
148146
149147def delete_custom_collections (session ):
150- """Delete all custom collections for the current user.
151- """
148+ """Delete all custom collections for the current user."""
152149 collections_url = '{}/v2/collections/' .format (session .api_base_url )
153150 data = session .get (collections_url )
154151
@@ -161,8 +158,7 @@ def delete_custom_collections(session):
161158# TODO rename this to get_node_providers, and create new function that actually IS get_node_addons -
162159# note, this is confusing, talk to BrianG before we change this
163160def get_node_addons (session , node_id ):
164- """Return a list of the names of all the addons connected to the given node.
165- """
161+ """Return a list of the names of all the addons connected to the given node."""
166162 url = '/v2/nodes/{}/files/' .format (node_id )
167163 data = session .get (url , query_parameters = {'page[size]' : 20 })
168164 providers = []
@@ -222,8 +218,7 @@ def upload_fake_file(
222218
223219
224220def delete_addon_files (session , provider , current_browser , guid ):
225- """Delete all files for the given addon.
226- """
221+ """Delete all files for the given addon."""
227222 files_url = '{}/v2/nodes/{}/files/{}/' .format (session .api_base_url , guid , provider )
228223
229224 data = session .get (url = files_url , query_parameters = {'page[size]' : 20 })
@@ -245,8 +240,7 @@ def delete_file(session, delete_url):
245240
246241
247242def get_providers_list (session = None , type = 'preprints' ):
248- """Return the providers list data. The default is the preprint providers list.
249- """
243+ """Return the providers list data. The default is the preprint providers list."""
250244 if not session :
251245 session = get_default_session ()
252246 url = '/v2/providers/' + type
@@ -265,14 +259,13 @@ def get_provider(session=None, type='registrations', provider_id='osf'):
265259
266260
267261def get_provider_submission_status (provider ):
268- """Return the boolean attribute `allow_submissions` from the dictionary object (provider)
269- """
262+ """Return the boolean attribute `allow_submissions` from the dictionary object (provider)"""
270263 return provider ['attributes' ]['allow_submissions' ]
271264
272265
273266def get_providers_total (provider_name , session ):
274- """ Return the total number of preprints for a given service provider.
275- Note: Reformat provider names to all lowercase and remove white spaces.
267+ """Return the total number of preprints for a given service provider.
268+ Note: Reformat provider names to all lowercase and remove white spaces.
276269 """
277270 provider_url = '/v2/providers/preprints/{}/preprints/' .format (
278271 provider_name .lower ().replace (' ' , '' )
@@ -281,7 +274,10 @@ def get_providers_total(provider_name, session):
281274
282275
283276def connect_provider_root_to_node (
284- session , provider , external_account_id , node_id = settings .PREFERRED_NODE ,
277+ session ,
278+ provider ,
279+ external_account_id ,
280+ node_id = settings .PREFERRED_NODE ,
285281):
286282 """Initialize the node<=>addon connection, add the given external_account_id, and configure it
287283 to connect to the root folder of the provider."""
0 commit comments