Coverage for cmds/calc.py: 43%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

7 statements  

1""" 

2calc.py 

3 

4contains calc 

5""" 

6 

7import urllib.parse 

8import error 

9 

10async def calc(*args): 

11 """ 

12 calc 

13 

14 "calculates" the given arguments 

15 """ 

16 

17 # fix args 

18 args = args[1:] 

19 

20 # check if there are any arguments 

21 if not args: 

22 raise error.ArgumentRequiredError 

23 

24 # return output 

25 return f"https://www.google.com.au/search?q={urllib.parse.quote(' '.join(args))}"