Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
47c3e7cd
Commit
47c3e7cd
authored
8 years ago
by
Nathaniel Manista
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #9735 from nathanielmanistaatgoogle/lint-fixes
Lint fixes.
parents
ac6323c7
a52d3bb3
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.pylintrc
+1
-4
1 addition, 4 deletions
.pylintrc
src/python/grpcio/grpc/_auth.py
+2
-5
2 additions, 5 deletions
src/python/grpcio/grpc/_auth.py
src/python/grpcio/grpc/_common.py
+16
-29
16 additions, 29 deletions
src/python/grpcio/grpc/_common.py
with
19 additions
and
38 deletions
.pylintrc
+
1
−
4
View file @
47c3e7cd
...
@@ -29,10 +29,7 @@
...
@@ -29,10 +29,7 @@
#TODO: Enable too-many-return-statements
#TODO: Enable too-many-return-statements
#TODO: Enable too-many-nested-blocks
#TODO: Enable too-many-nested-blocks
#TODO: Enable super-init-not-called
#TODO: Enable super-init-not-called
#TODO: Enable simplifiable-if-statement
#TODO: Enable no-self-use
#TODO: Enable no-self-use
#TODO: Enable no-member
#TODO: Enable no-member
#TODO: Enable logging-format-interpolation
#TODO: Enable dangerous-default-value
disable=missing-docstring,too-few-public-methods,too-many-arguments,no-init,duplicate-code,invalid-name,suppressed-message,locally-disabled,protected-access,no-name-in-module,unused-argument,fixme,wrong-import-order,no-value-for-parameter,cyclic-import,unused-variable,redefined-outer-name,unused-import,too-many-instance-attributes,broad-except,too-many-locals,too-many-lines,redefined-variable-type,next-method-called,import-error,useless-else-on-loop,too-many-return-statements,too-many-nested-blocks,super-init-not-called,
simplifiable-if-statement,no-self-use,no-member,logging-format-interpolation,dangerous-default-value
disable=missing-docstring,too-few-public-methods,too-many-arguments,no-init,duplicate-code,invalid-name,suppressed-message,locally-disabled,protected-access,no-name-in-module,unused-argument,fixme,wrong-import-order,no-value-for-parameter,cyclic-import,unused-variable,redefined-outer-name,unused-import,too-many-instance-attributes,broad-except,too-many-locals,too-many-lines,redefined-variable-type,next-method-called,import-error,useless-else-on-loop,too-many-return-statements,too-many-nested-blocks,super-init-not-called,
no-self-use,no-member
This diff is collapsed.
Click to expand it.
src/python/grpcio/grpc/_auth.py
+
2
−
5
View file @
47c3e7cd
...
@@ -48,11 +48,8 @@ class GoogleCallCredentials(grpc.AuthMetadataPlugin):
...
@@ -48,11 +48,8 @@ class GoogleCallCredentials(grpc.AuthMetadataPlugin):
# Hack to determine if these are JWT creds and we need to pass
# Hack to determine if these are JWT creds and we need to pass
# additional_claims when getting a token
# additional_claims when getting a token
if
'
additional_claims
'
in
inspect
.
getargspec
(
self
.
_is_jwt
=
'
additional_claims
'
in
inspect
.
getargspec
(
credentials
.
get_access_token
).
args
:
credentials
.
get_access_token
).
args
self
.
_is_jwt
=
True
else
:
self
.
_is_jwt
=
False
def
__call__
(
self
,
context
,
callback
):
def
__call__
(
self
,
context
,
callback
):
# MetadataPlugins cannot block (see grpc.beta.interfaces.py)
# MetadataPlugins cannot block (see grpc.beta.interfaces.py)
...
...
This diff is collapsed.
Click to expand it.
src/python/grpcio/grpc/_common.py
+
16
−
29
View file @
47c3e7cd
...
@@ -92,7 +92,7 @@ def decode(b):
...
@@ -92,7 +92,7 @@ def decode(b):
try
:
try
:
return
b
.
decode
(
'
utf8
'
)
return
b
.
decode
(
'
utf8
'
)
except
UnicodeDecodeError
:
except
UnicodeDecodeError
:
logging
.
exception
(
'
Invalid encoding on
{}
'
.
format
(
b
)
)
logging
.
exception
(
'
Invalid encoding on
%s
'
,
b
)
return
b
.
decode
(
'
latin1
'
)
return
b
.
decode
(
'
latin1
'
)
...
@@ -148,36 +148,23 @@ def fully_qualified_method(group, method):
...
@@ -148,36 +148,23 @@ def fully_qualified_method(group, method):
class
CleanupThread
(
threading
.
Thread
):
class
CleanupThread
(
threading
.
Thread
):
"""
A threading.Thread subclass supporting custom behavior on join().
"""
A threading.Thread subclass supporting custom behavior on join().
On Python Interpreter exit, Python will attempt to join outstanding threads
On Python Interpreter exit, Python will attempt to join outstanding threads
prior to garbage collection. We may need to do additional cleanup, and
prior to garbage collection. We may need to do additional cleanup, and
we accomplish this by overriding the join() method.
we accomplish this by overriding the join() method.
"""
"""
def
__init__
(
self
,
def
__init__
(
self
,
behavior
,
*
args
,
**
kwargs
):
behavior
,
group
=
None
,
target
=
None
,
name
=
None
,
args
=
(),
kwargs
=
{}):
"""
Constructor.
"""
Constructor.
Args:
Args:
behavior (function): Function called on join() with a single
behavior (function): Function called on join() with a single
argument, timeout, indicating the maximum duration of
argument, timeout, indicating the maximum duration of
`behavior`, or None indicating `behavior` has no deadline.
`behavior`, or None indicating `behavior` has no deadline.
`behavior` must be idempotent.
`behavior` must be idempotent.
group (None): should be None. Reseved for future extensions
args: Positional arguments passed to threading.Thread constructor.
when ThreadGroup is implemented.
kwargs: Keyword arguments passed to threading.Thread constructor.
target (function): The function to invoke when this thread is
"""
run. Defaults to None.
super
(
CleanupThread
,
self
).
__init__
(
*
args
,
**
kwargs
)
name (str): The name of this thread. Defaults to None.
args (tuple[object]): A tuple of arguments to pass to `target`.
kwargs (dict[str,object]): A dictionary of keyword arguments to
pass to `target`.
"""
super
(
CleanupThread
,
self
).
__init__
(
group
=
group
,
target
=
target
,
name
=
name
,
args
=
args
,
kwargs
=
kwargs
)
self
.
_behavior
=
behavior
self
.
_behavior
=
behavior
def
join
(
self
,
timeout
=
None
):
def
join
(
self
,
timeout
=
None
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment