Skip to content

Commit

Permalink
Remove unused utils
Browse files Browse the repository at this point in the history
  • Loading branch information
randomir committed Feb 13, 2021
1 parent de1d01e commit 88e68e0
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions dwave/cloud/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
_numpy = False

__all__ = ['evaluate_ising', 'uniform_iterator', 'uniform_get',
'default_text_input', 'click_info_switch', 'datetime_to_timestamp',
'default_text_input', 'datetime_to_timestamp',
'datetime_to_timestamp', 'utcnow', 'epochnow', 'tictoc',
'hasinstance', 'exception_chain', 'is_caused_by']

Expand Down Expand Up @@ -190,34 +190,6 @@ def default_text_input(prompt, default=None, optional=True):
return input_with_default(prompt, default, optional)


def click_info_switch(f):
"""Decorator to create eager Click info switch option, as described in:
http://click.pocoo.org/6/options/#callbacks-and-eager-options.
Takes a no-argument function and abstracts the boilerplate required by
Click (value checking, exit on done).
Example:
@click.option('--my-option', is_flag=True, callback=my_option,
expose_value=False, is_eager=True)
def test():
pass
@click_info_switch
def my_option()
click.echo('some info related to my switch')
"""

@wraps(f)
def wrapped(ctx, param, value):
if not value or ctx.resilient_parsing:
return
f()
ctx.exit()
return wrapped


def datetime_to_timestamp(dt):
"""Convert timezone-aware `datetime` to POSIX timestamp and
return seconds since UNIX epoch.
Expand Down

0 comments on commit 88e68e0

Please sign in to comment.