-
-
Notifications
You must be signed in to change notification settings - Fork 19
use python 3.6 typing #33
Conversation
all variables and functions are typed in order to help with refactoring fix mre#31
|
Amazing! That was fast. 🚀 |
| # Call ffmpeg with settings compatible with QuickTime. | ||
| # https://superuser.com/a/820137 | ||
| command = ["/usr/local/bin/ffmpeg", "-y", | ||
| command: List[str]= ["/usr/local/bin/ffmpeg", "-y", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guess this needs a
from typing import List
import to work properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 👍
db3330a
timelapse/recorder.py
Outdated
| str(get_screen_with_mouse_index() + 1), '-t', self.format, filename], | ||
| check=True) | ||
| self.screenshot_counter += 1 | ||
| check: bool =True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a parameter that we pass to subprocess.run. check=True is equivalent to writing True in this case. We just use a named parameter here because it's more readable for 👨 👩. Guess we have to remove this type hint to make it syntactically correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 👍 bb76c7c
Type hints are only allowed when a new variable is defined.
Type hints are only allowed when a new variable is defined.
|
Skipped some more type hints for reassignments. |
|
Wooo! Thanks for letting me help! |
|
Does it make sense at this point to add Mypy would greatly help catch things like how a EDIT: mypy reports multiple typing errors (omitting the library stubs missing as that was expected and can be configured off): I'd be happy to submit a PR that
Just let me know if this is something you'd be interested in. Glad to see this project make use of Python typing. I think its really valuable. |
|
Thanks for looking into this @estysdesu. |
There's a bit of work to do, I guess. 😆 |
all variables and functions are typed in order to help with refactoring
fix #31
Description
Types of Changes
Issues Fixed or Closed by This PR
#31
Checklist