Skip to content

Commit

Permalink
Remove None from param types and add (Optional).
Browse files Browse the repository at this point in the history
This runs a script to remove None from the types for parameters, and
added (Optional) to the description. Does not pass lint due to some
too-long lines. I will clean those up manually.

See:
googleapis/google-cloud-python#2580 (review)
  • Loading branch information
tswast committed Oct 21, 2016
1 parent 6f17fa9 commit 2eccae3
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 43 deletions.
4 changes: 2 additions & 2 deletions google/cloud/logging/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ def _entry_from_resource(self, resource, loggers):
:type resource: dict
:param resource: one entry resource from API response
:type loggers: dict or None
:param loggers: A mapping of logger fullnames -> loggers. If not
:type loggers: dict
:param loggers: (Optional) A mapping of logger fullnames -> loggers. If not
passed, the entry will have a newly-created logger.
:rtype: One of:
Expand Down
14 changes: 7 additions & 7 deletions google/cloud/logging/entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@ class _BaseEntry(object):
:type logger: :class:`google.cloud.logging.logger.Logger`
:param logger: the logger used to write the entry.
:type insert_id: text, or :class:`NoneType`
:type insert_id: text
:param insert_id: (optional) the ID used to identify an entry uniquely.
:type timestamp: :class:`datetime.datetime`, or :class:`NoneType`
:type timestamp: :class:`datetime.datetime`
:param timestamp: (optional) timestamp for the entry
:type labels: dict or :class:`NoneType`
:type labels: dict
:param labels: (optional) mapping of labels for the entry
:type severity: str or :class:`NoneType`
:type severity: str
:param severity: (optional) severity of event being logged.
:type http_request: dict or :class:`NoneType`
:type http_request: dict
:param http_request: (optional) info about HTTP request associated with
the entry
"""
Expand All @@ -94,8 +94,8 @@ def from_api_repr(cls, resource, client, loggers=None):
:param client: Client which holds credentials and project
configuration.
:type loggers: dict or None
:param loggers: A mapping of logger fullnames -> loggers. If not
:type loggers: dict
:param loggers: (Optional) A mapping of logger fullnames -> loggers. If not
passed, the entry will have a newly-created logger.
:rtype: :class:`google.cloud.logging.entries.TextEntry`
Expand Down
68 changes: 34 additions & 34 deletions google/cloud/logging/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Logger(object):
:param client: A client which holds credentials and project configuration
for the logger (which requires a project).
:type labels: dict or :class:`NoneType`
:type labels: dict
:param labels: (optional) mapping of default labels for entries written
via this logger.
"""
Expand Down Expand Up @@ -99,25 +99,25 @@ def _make_entry_resource(self, text=None, info=None, message=None,
Only one of ``text``, ``info``, or ``message`` should be passed.
:type text: str or :class:`NoneType`
:param text: text payload
:type text: str
:param text: (Optional) text payload
:type info: dict or :class:`NoneType`
:param info: struct payload
:type info: dict
:param info: (Optional) struct payload
:type message: Protobuf message or :class:`NoneType`
:param message: protobuf payload
:type labels: dict or :class:`NoneType`
:param labels: labels passed in to calling method.
:type labels: dict
:param labels: (Optional) labels passed in to calling method.
:type insert_id: str or :class:`NoneType`
:type insert_id: str
:param insert_id: (optional) unique ID for log entry.
:type severity: str or :class:`NoneType`
:type severity: str
:param severity: (optional) severity of event being logged.
:type http_request: dict or :class:`NoneType`
:type http_request: dict
:param http_request: (optional) info about HTTP request associated with
the entry
Expand Down Expand Up @@ -172,16 +172,16 @@ def log_text(self, text, client=None, labels=None, insert_id=None,
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current logger.
:type labels: dict or :class:`NoneType`
:type labels: dict
:param labels: (optional) mapping of labels for the entry.
:type insert_id: str or :class:`NoneType`
:type insert_id: str
:param insert_id: (optional) unique ID for log entry.
:type severity: str or :class:`NoneType`
:type severity: str
:param severity: (optional) severity of event being logged.
:type http_request: dict or :class:`NoneType`
:type http_request: dict
:param http_request: (optional) info about HTTP request associated with
the entry
"""
Expand All @@ -206,16 +206,16 @@ def log_struct(self, info, client=None, labels=None, insert_id=None,
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current logger.
:type labels: dict or :class:`NoneType`
:type labels: dict
:param labels: (optional) mapping of labels for the entry.
:type insert_id: str or :class:`NoneType`
:type insert_id: str
:param insert_id: (optional) unique ID for log entry.
:type severity: str or :class:`NoneType`
:type severity: str
:param severity: (optional) severity of event being logged.
:type http_request: dict or :class:`NoneType`
:type http_request: dict
:param http_request: (optional) info about HTTP request associated with
the entry.
"""
Expand All @@ -240,16 +240,16 @@ def log_proto(self, message, client=None, labels=None, insert_id=None,
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current logger.
:type labels: dict or :class:`NoneType`
:type labels: dict
:param labels: (optional) mapping of labels for the entry.
:type insert_id: str or :class:`NoneType`
:type insert_id: str
:param insert_id: (optional) unique ID for log entry.
:type severity: str or :class:`NoneType`
:type severity: str
:param severity: (optional) severity of event being logged.
:type http_request: dict or :class:`NoneType`
:type http_request: dict
:param http_request: (optional) info about HTTP request associated with
the entry.
"""
Expand Down Expand Up @@ -347,16 +347,16 @@ def log_text(self, text, labels=None, insert_id=None, severity=None,
:type text: str
:param text: the text entry
:type labels: dict or :class:`NoneType`
:type labels: dict
:param labels: (optional) mapping of labels for the entry.
:type insert_id: str or :class:`NoneType`
:type insert_id: str
:param insert_id: (optional) unique ID for log entry.
:type severity: str or :class:`NoneType`
:type severity: str
:param severity: (optional) severity of event being logged.
:type http_request: dict or :class:`NoneType`
:type http_request: dict
:param http_request: (optional) info about HTTP request associated with
the entry.
"""
Expand All @@ -370,16 +370,16 @@ def log_struct(self, info, labels=None, insert_id=None, severity=None,
:type info: dict
:param info: the struct entry
:type labels: dict or :class:`NoneType`
:type labels: dict
:param labels: (optional) mapping of labels for the entry.
:type insert_id: str or :class:`NoneType`
:type insert_id: str
:param insert_id: (optional) unique ID for log entry.
:type severity: str or :class:`NoneType`
:type severity: str
:param severity: (optional) severity of event being logged.
:type http_request: dict or :class:`NoneType`
:type http_request: dict
:param http_request: (optional) info about HTTP request associated with
the entry.
"""
Expand All @@ -393,16 +393,16 @@ def log_proto(self, message, labels=None, insert_id=None, severity=None,
:type message: protobuf message
:param message: the protobuf entry
:type labels: dict or :class:`NoneType`
:type labels: dict
:param labels: (optional) mapping of labels for the entry.
:type insert_id: str or :class:`NoneType`
:type insert_id: str
:param insert_id: (optional) unique ID for log entry.
:type severity: str or :class:`NoneType`
:type severity: str
:param severity: (optional) severity of event being logged.
:type http_request: dict or :class:`NoneType`
:type http_request: dict
:param http_request: (optional) info about HTTP request associated with
the entry.
"""
Expand Down

0 comments on commit 2eccae3

Please sign in to comment.