Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ it's good to know that the system works this way.
```{eval-rst}
.. click:example::

import urllib
import urllib.request

def open_url(ctx, param, value):
if value is not None:
ctx.params['fp'] = urllib.urlopen(value)
ctx.params['fp'] = urllib.request.urlopen(value)
return value

@click.command()
Expand All @@ -149,7 +149,7 @@ the information in a wrapper, however:

.. click:example::

import urllib
import urllib.request

class URL(object):

Expand All @@ -159,7 +159,7 @@ the information in a wrapper, however:

def open_url(ctx, param, value):
if value is not None:
return URL(value, urllib.urlopen(value))
return URL(value, urllib.request.urlopen(value))

@click.command()
@click.option('--url', callback=open_url)
Expand Down Expand Up @@ -321,7 +321,7 @@ are important to know about how this ignoring of unhandled flag happens:
- Unknown short options might be partially handled and reassembled if
necessary. For instance in the above example there is an option
called `-v` which enables verbose mode. If the command would be
ignored with `-va` then the `-v` part would be handled by Click
invoked with `-va` then the `-v` part would be handled by Click
(as it is known) and `-a` would end up in the leftover parameters
for further processing.
- Depending on what you plan on doing you might have some success by
Expand Down