Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
e2c8b46
fixed the header levels in the sprite doc
rich-saupe Mar 2, 2024
c2dcc0f
Revert "fixed the header levels in the sprite doc"
rich-saupe Mar 2, 2024
b0d6718
Merge branch 'pythonarcade:development' into development
sabadam32 Mar 4, 2024
5377d26
Merge branch 'development' of https://github.com/pythonarcade/arcade …
rich-saupe Mar 7, 2024
b8ff2f4
Merge branch 'development' of https://github.com/pythonarcade/arcade …
rich-saupe Mar 10, 2024
6d5b217
Merge branch 'development' of https://github.com/pythonarcade/arcade …
rich-saupe Mar 14, 2024
37a5224
Merge branch 'development' of https://github.com/pythonarcade/arcade …
rich-saupe Mar 29, 2024
7523e89
added screenshot functions
rich-saupe Mar 29, 2024
cc598c8
fix tests
rich-saupe Mar 29, 2024
3d47991
fix locations
rich-saupe Mar 29, 2024
e061b0c
removed stash file and updated screenshot oath
rich-saupe Mar 29, 2024
ce14121
fix tests
rich-saupe Mar 29, 2024
3472eab
Use cleaner pytest screenshot fixtures
pushfoo Mar 29, 2024
d38d28e
Try to make Window.save_screenshot friendlier + better documented
pushfoo Mar 31, 2024
b104c00
Use shorter intersphinx mapping instead of full URL
pushfoo Mar 31, 2024
931075e
Phrasing tweak for Window.save_screenshot docstring
pushfoo Mar 31, 2024
6811519
Sync implementation + docstring for window_command.save_screenshot
pushfoo Mar 31, 2024
b377f88
Use intersphinx link in screenshot kwargs field
pushfoo Mar 31, 2024
0dcdcf1
Add Window.save_timestamped_screenshot method + doc
pushfoo Mar 31, 2024
161566e
Add creenshot / helper doc, helpers, and examples
pushfoo Mar 31, 2024
29ccec7
Revert get_timestamped_screenshot
pushfoo Mar 31, 2024
2b74056
Spacing in Window.__init__
pushfoo Mar 31, 2024
f70685a
Revert whitespace noise in application.py
pushfoo Mar 31, 2024
6741ea9
Commit overlooked example py file + screenshot for doc
pushfoo Mar 31, 2024
eb900a6
Fix code-block directive spacing
pushfoo Mar 31, 2024
b6b5341
Better date and time section tweaks
pushfoo Mar 31, 2024
b53b413
Intro block revision
pushfoo Mar 31, 2024
c42872a
Second pair of intro tweaks
pushfoo Mar 31, 2024
ae00a90
Add module-level spacing above get_timestamp
pushfoo Apr 2, 2024
2dfd5b5
Put format string first in get_timestamp
pushfoo Apr 2, 2024
09a363e
Add tzinfo to get_timestamp
pushfoo Apr 2, 2024
50d38ee
Account for DX + Sabadam32's suggestions
pushfoo Apr 2, 2024
e6a708a
Add timezone to format string + clean up tests
pushfoo Apr 3, 2024
d7eeecb
Phrasing tweak to intro
pushfoo Apr 3, 2024
8e92ac5
Merge pull request #1 from pushfoo/screenshot_pr_cleaning
sabadam32 Apr 4, 2024
f585d83
add in get_image
rich-saupe Apr 4, 2024
37b0962
Merge branch 'development' of https://github.com/pythonarcade/arcade …
rich-saupe Apr 5, 2024
caa493e
Merge branch 'development' into add_screenshot_1342
rich-saupe Apr 5, 2024
5aafe39
fix typing errors
rich-saupe Apr 5, 2024
90164e8
fix type error
rich-saupe Apr 5, 2024
58f2d70
removed datetime type
rich-saupe Apr 6, 2024
ff1abb1
Merge branch 'development' of https://github.com/pythonarcade/arcade …
rich-saupe Apr 6, 2024
a2278d3
Merge branch 'development' of https://github.com/pythonarcade/arcade …
rich-saupe Apr 20, 2024
d9c0178
Merge branch 'development' into add_screenshot_1342
rich-saupe Apr 20, 2024
856689a
Merge branch 'development' of https://github.com/pythonarcade/arcade …
rich-saupe Apr 30, 2024
43e6ac5
Merge branch 'development' into add_screenshot_1342
rich-saupe Apr 30, 2024
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
6 changes: 3 additions & 3 deletions arcade/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Error out if we import Arcade with an incompatible version of Python.
import sys
import os
from datetime import datetime
from datetime import datetime, _TzInfo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My initial PR might have been a little busted due to my local nodejs breaking my pyright (I know pyright shouldn't depend on node, but it does 😢). This should work (I think):

Suggested change
from datetime import datetime, _TzInfo
from datetime import datetime, tzinfo

The Python source for the datetime module shows it as a real ABC, and it should be less brittle than _TZInfo.

from typing import Optional

from pathlib import Path
Expand Down Expand Up @@ -37,8 +37,8 @@ def configure_logging(level: Optional[int] = None):

def get_timestamp(
how: str = "%Y_%m_%d_%H%M_%S_%f%Z",
when: Optional[types.HasStrftime] = None,
tzinfo: Optional[datetime.tzinfo] = None
when: Optional[types.HasStrftime | datetime] = None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Did HasStrftime not match datetime? Was it only pyright which complained?
  2. To my understanding, the | syntax is a 3.9+ feature, but we support 3.8+

Copy link
Contributor Author

@sabadam32 sabadam32 Apr 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it didn't. pyright complained for sure, but I don't remember if the build failed due to this check

Copy link
Member

@pushfoo pushfoo Apr 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure? I see references to line 41 in the GitHub CI builds on the previous commits. That's the other line it seems.

tzinfo: Optional[_TzInfo] = None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I removed a top-level datetime import but left behind the broken property datetime.tzinfo line earlier. With the import suggestion at the top, I think this should work.

Suggested change
tzinfo: Optional[_TzInfo] = None
tzinfo: Optional[tzinfo] = None

) -> str:
"""Return a timestamp as a formatted string.

Expand Down