Skip to content

Commit 350bac2

Browse files
committed
Document InputStream properties
While at it, fix the default Python source file name to __init__.py Issue #94.
1 parent 0781784 commit 350bac2

File tree

2 files changed

+29
-11
lines changed

2 files changed

+29
-11
lines changed

azure/functions/_abc.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,24 @@ def read(self, size=-1) -> bytes:
139139
"""
140140
pass
141141

142+
@property
143+
@abc.abstractmethod
144+
def name(self) -> typing.Optional[str]:
145+
"""The name of the blob."""
146+
pass
147+
148+
@property
149+
@abc.abstractmethod
150+
def length(self) -> typing.Optional[int]:
151+
"""The size of the blob in bytes."""
152+
pass
153+
154+
@property
155+
@abc.abstractmethod
156+
def uri(self) -> typing.Optional[str]:
157+
"""The blob's primary location URI."""
158+
pass
159+
142160

143161
class QueueMessage(abc.ABC):
144162

docs/index.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Programming Model
1616
=================
1717

1818
An Azure function is implemented as a global Python function ``main()`` in the
19-
file called ``main.py``. The name of the Python function can be changed by
19+
file called ``__init__.py``. The name of the Python function can be changed by
2020
specifying the ``entryPoint`` attribute in ``function.json``, and the name of
2121
the file can be changed by specifying the ``scriptFile`` attribute in
2222
``function.json``.
@@ -33,7 +33,7 @@ Below is an example of a simple function triggerred by an HTTP request.
3333
.. code-block:: json
3434
3535
{
36-
"scriptFile": "main.py",
36+
"scriptFile": "__init__.py",
3737
"disabled": false,
3838
"bindings": [
3939
{
@@ -51,7 +51,7 @@ Below is an example of a simple function triggerred by an HTTP request.
5151
}
5252
5353
54-
``main.py``:
54+
``__init__.py``:
5555

5656
.. code-block:: python
5757
@@ -124,7 +124,7 @@ Example
124124
.. code-block:: json
125125
126126
{
127-
"scriptFile": "main.py",
127+
"scriptFile": "__init__.py",
128128
"disabled": false,
129129
"bindings": [
130130
{
@@ -142,7 +142,7 @@ Example
142142
}
143143
144144
145-
``main.py``:
145+
``__init__.py``:
146146

147147
.. code-block:: python
148148
@@ -189,7 +189,7 @@ Blob storage trigger example
189189
}
190190
191191
192-
``main.py``:
192+
``__init__.py``:
193193

194194

195195
.. code-block:: python
@@ -232,7 +232,7 @@ Blob storage output example
232232
}
233233
234234
235-
``main.py``:
235+
``__init__.py``:
236236

237237

238238
.. code-block:: python
@@ -272,7 +272,7 @@ Example
272272
.. code-block:: json
273273
274274
{
275-
"scriptFile": "main.py",
275+
"scriptFile": "__init__.py",
276276
277277
"bindings": [
278278
{
@@ -293,7 +293,7 @@ Example
293293
}
294294
295295
296-
``main.py``:
296+
``__init__.py``:
297297

298298
.. code-block:: python
299299
@@ -326,7 +326,7 @@ Example
326326
.. code-block:: json
327327
328328
{
329-
"scriptFile": "main.py",
329+
"scriptFile": "__init__.py",
330330
331331
"bindings": [
332332
{
@@ -346,7 +346,7 @@ Example
346346
}
347347
348348
349-
``main.py``:
349+
``__init__.py``:
350350

351351
.. code-block:: python
352352

0 commit comments

Comments
 (0)