Skip to content

Commit 7e2b4fa

Browse files
committed
Bump to v1.0.6
- Correct arrow url in ReadMe - Let more than 10 results per request be returned (now 50) - Bump to 1.0.6
1 parent 4a2d1fc commit 7e2b4fa

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

QOpenScienceFramework/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "1.0.5"
1+
__version__ = "1.0.6"
22
__author__ = "Daniel Schreij"
33

44
import os

QOpenScienceFramework/widgets.py

+12
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,9 @@ def __clicked_new_folder(self):
984984

985985
# Remove illegal filesystem characters (mainly for Windows)
986986
new_folder_name = "".join(i for i in new_folder_name if i not in r'\/:*?"<>|')
987+
# Check again
988+
if not len(new_folder_name):
989+
return
987990

988991
new_folder_url += "&name={}".format(new_folder_name)
989992
self.manager.put(
@@ -1154,6 +1157,9 @@ class ProjectTree(QtWidgets.QTreeWidget):
11541157

11551158
# Event fired when refresh of tree is finished
11561159
refreshFinished = QtCore.pyqtSignal()
1160+
# Maximum of items to return per request (e.g. files in a folder). OSF
1161+
# automatically paginates its results
1162+
ITEMS_PER_PAGE = 50
11571163

11581164
def __init__(self, manager, use_theme=None, theme_path='./resources/iconthemes'):
11591165
""" Constructor
@@ -1530,6 +1536,9 @@ def populate_tree(self, reply, parent=None):
15301536
except AttributeError as e:
15311537
raise osf.OSFInvalidResponse("Invalid api call for getting next"
15321538
"entry point: {}".format(e))
1539+
# Add page size parameter to url to let more than 10 results per page be
1540+
# returned
1541+
next_entrypoint += "?page[size]={}".format(self.ITEMS_PER_PAGE)
15331542
req = self.manager.get(
15341543
next_entrypoint,
15351544
self.populate_tree,
@@ -1586,6 +1595,9 @@ def process_repo_contents(self, logged_in_user):
15861595
)
15871596
# Clear the tree to be sure
15881597
self.clear()
1598+
# Add the max items to return per request to the api url
1599+
user_nodes_api_call += "?page[size]={}".format(self.ITEMS_PER_PAGE)
1600+
15891601
# Start populating the tree
15901602
req = self.manager.get(
15911603
user_nodes_api_call,

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Make sure you have the following modules available (all should be easy to get wi
99
- qtawesome (https://github.com/spyder-ide/qtawesome)
1010
- requests_oauthlib (https://github.com/requests/requests-oauthlib)
1111
- fileinspector (https://github.com/dschreij/fileinspector)
12-
- arrow (http://crsmithdev.com/arrow/pytho)
12+
- arrow (http://crsmithdev.com/arrow/)
1313
- humanize (https://pypi.python.org/pypi/humanize)
1414
- python-magic (optional)
1515

0 commit comments

Comments
 (0)