56
56
.replace ('``' , '\' ' ))
57
57
for k , v in metavar_docs .items ()])
58
58
59
+ DEFAULT_SEARCH_LIMIT = 100
60
+ MAX_PAGE_SIZE = 250
61
+
59
62
60
63
@cli .group ('data' )
61
64
def data ():
@@ -77,15 +80,15 @@ def filter_dump(**kw):
77
80
78
81
79
82
@data .command ('search' , epilog = filter_opts_epilog )
80
- @limit_option (100 )
83
+ @limit_option (DEFAULT_SEARCH_LIMIT )
81
84
@pretty
82
85
@asset_type_perms
83
86
@search_request_opts
84
87
def quick_search (limit , pretty , sort , ** kw ):
85
88
'''Execute a quick search.'''
86
89
req = search_req_from_opts (** kw )
87
90
cl = clientv1 ()
88
- page_size = min (limit , 250 )
91
+ page_size = min (limit , MAX_PAGE_SIZE )
89
92
echo_json_response (call_and_wrap (
90
93
cl .quick_search , req , page_size = page_size , sort = sort
91
94
), pretty , limit )
@@ -107,12 +110,12 @@ def create_search(pretty, **kw):
107
110
@click .argument ('search_id' , default = '@-' , required = False )
108
111
@sort_order
109
112
@pretty
110
- @limit_option (100 )
113
+ @limit_option (DEFAULT_SEARCH_LIMIT )
111
114
def saved_search (search_id , sort , pretty , limit ):
112
115
'''Execute a saved search'''
113
116
sid = read (search_id )
114
117
cl = clientv1 ()
115
- page_size = min (limit , 250 )
118
+ page_size = min (limit , MAX_PAGE_SIZE )
116
119
echo_json_response (call_and_wrap (
117
120
cl .saved_search , sid , page_size = page_size , sort = sort
118
121
), limit = limit , pretty = pretty )
@@ -174,7 +177,7 @@ def download(asset_type, dest, limit, sort, search_id, dry_run, activate_only,
174
177
quiet , ** kw ):
175
178
'''Activate and download'''
176
179
cl = clientv1 ()
177
- page_size = min (limit or 250 , 250 )
180
+ page_size = min (limit or MAX_PAGE_SIZE , MAX_PAGE_SIZE )
178
181
asset_type = list (chain .from_iterable (asset_type ))
179
182
# even though we're using functionality from click.Path, this was needed
180
183
# to detect inability to write on Windows in a read-only vagrant mount...
0 commit comments