Skip to content

Commit 780ebeb

Browse files
committed
Create s3 directory wrapper
1 parent d853f55 commit 780ebeb

File tree

4 files changed

+311
-230
lines changed

4 files changed

+311
-230
lines changed

.doc_gen/metadata/s3-directory-buckets_metadata.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,21 @@ s3-directory-buckets_UploadPart:
391391
services:
392392
s3-directory-buckets: {UploadPart}
393393

394+
s3-directory-buckets_CreateSession:
395+
languages:
396+
Python:
397+
versions:
398+
- sdk_version: 3
399+
github: python/example_code/s3-directory-buckets
400+
sdkguide:
401+
excerpts:
402+
- description:
403+
snippet_tags:
404+
- python.example_code.s3_directory.S3ExpressWrapper.decl
405+
- python.example_code.s3_directory.CreateSession
406+
services:
407+
s3-directory-buckets: {CreateSession}
408+
394409
s3-directory-buckets_Scenario_ExpressBasics:
395410
synopsis_list:
396411
- Set up a VPC and VPC Endpoint.

python/demo_tools/question.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
and converts input, and returns answers.
77
"""
88

9+
import re
910

1011
# snippet-start:[python.demo_tools.Question]
1112
def ask(question, *validators):
@@ -101,5 +102,18 @@ def _validate(answer):
101102

102103
return _validate
103104

105+
def re_match(pattern):
106+
"""
107+
Validate that the answer matches a regular expression.
108+
:return: The answer, if it is a match; otherwise, None.
109+
"""
110+
111+
def _validate(answer):
112+
return (
113+
answer if re.match(pattern, answer) is not None else None,
114+
f"{answer} must match the regular expression {pattern}.",
115+
)
116+
117+
return _validate
104118

105119
# snippet-end:[python.demo_tools.Question]

0 commit comments

Comments
 (0)