Skip to content

Commit

Permalink
fix lint in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
reyang committed Mar 21, 2019
1 parent 2879cc3 commit fee695c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
7 changes: 6 additions & 1 deletion contrib/opencensus-context/examples/async_span.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ def __init__(self, name):
self.parent = RuntimeContext.current_span

def __repr__(self):
return ('{}(name={}, parent={})'.format(type(self).__name__, self.name, self.parent))
return ('{}(name={}, parent={})'
.format(
type(self).__name__,
self.name,
self.parent,
))

async def __aenter__(self):
RuntimeContext.current_span = self
Expand Down
5 changes: 4 additions & 1 deletion contrib/opencensus-context/examples/explicit_threading.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ def work(name):
print('Main thread:', RuntimeContext)

# user can propagate context explicitly
thread = Thread(target=RuntimeContext.with_current_context(work), args=('bar',))
thread = Thread(
target=RuntimeContext.with_current_context(work),
args=('bar',),
)
thread.start()
thread.join()

Expand Down
2 changes: 1 addition & 1 deletion contrib/opencensus-context/examples/thread_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def work(name):
if __name__ == "__main__":
println('Main thread: {}'.format(RuntimeContext))
RuntimeContext.operation_id = 'main'
pool = ThreadPool(2) # create a thread pool with 2 threads
pool = ThreadPool(2) # create a thread pool with 2 threads
pool.map(RuntimeContext.with_current_context(work), [
'bear',
'cat',
Expand Down

0 comments on commit fee695c

Please sign in to comment.