pynintendoparental 0.7.1__py3-none-any.whl → 0.7.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- __version__ = "0.7.1"
1
+ __version__ = "0.7.2"
@@ -63,7 +63,7 @@ class Authenticator:
63
63
  self,
64
64
  session_token = None,
65
65
  auth_code_verifier = None,
66
- session: aiohttp.ClientSession = None
66
+ client_session: aiohttp.ClientSession = None
67
67
  ):
68
68
  """Basic init."""
69
69
  _LOGGER.debug(">> Init authenticator.")
@@ -77,9 +77,9 @@ class Authenticator:
77
77
  self._id_token: str = None
78
78
  self._session_token: str = session_token
79
79
  self.login_url: str = None
80
- if session is None:
81
- session = aiohttp.ClientSession()
82
- self.client_session: aiohttp.ClientSession = session
80
+ if client_session is None:
81
+ client_session = aiohttp.ClientSession()
82
+ self.client_session: aiohttp.ClientSession = client_session
83
83
 
84
84
  @property
85
85
  def get_session_token(self) -> str:
@@ -182,11 +182,13 @@ class Authenticator:
182
182
  self.account = account["json"]
183
183
 
184
184
  @classmethod
185
- def generate_login(cls) -> 'Authenticator':
185
+ def generate_login(
186
+ cls,
187
+ client_session: aiohttp.ClientSession | None = None) -> 'Authenticator':
186
188
  """Starts configuration of the authenticator."""
187
189
  verifier = _rand()
188
190
 
189
- auth = cls(auth_code_verifier=verifier)
191
+ auth = cls(auth_code_verifier=verifier, client_session=client_session)
190
192
 
191
193
  query = {
192
194
  "client_id": CLIENT_ID,
@@ -207,10 +209,11 @@ class Authenticator:
207
209
  async def complete_login(cls,
208
210
  auth: Authenticator | None,
209
211
  response_token: str,
210
- is_session_token: bool=False) -> Authenticator:
212
+ is_session_token: bool=False,
213
+ client_session: aiohttp.ClientSession | None = None) -> Authenticator:
211
214
  """Creates and logs into Nintendo APIs"""
212
215
  if is_session_token:
213
- auth = cls(session_token=response_token)
216
+ auth = cls(session_token=response_token, client_session=client_session)
214
217
  await auth.perform_refresh()
215
218
  else:
216
219
  response_token = _parse_response_token(response_token)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pynintendoparental
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: A Python module to interact with Nintendo Parental Controls
5
5
  Home-page: http://github.com/pantherale0/pynintendoparental
6
6
  Author: pantherale0
@@ -1,5 +1,5 @@
1
1
  pynintendoparental/__init__.py,sha256=bvsCZ4_n8Ud6M1u3whiN14tAW5KSTnVH57CAUvWCIwk,2028
2
- pynintendoparental/_version.py,sha256=2KJZDSMOG7KS82AxYOrZ4ZihYxX0wjfUjDsIZh3L024,22
2
+ pynintendoparental/_version.py,sha256=lcrcqfPdVkkAQSUY7-6U3m2gooWLXX_neDSS8dIuHdc,22
3
3
  pynintendoparental/api.py,sha256=heF2RlmvNA1VV0CI-AxLvYOCZ5mGQcxDiSr_gKdqeDI,7027
4
4
  pynintendoparental/application.py,sha256=l-oVwM4hrVVUf_2djQ7rJVya7LQP38yhaLPAWt8V8TY,3941
5
5
  pynintendoparental/const.py,sha256=41Mn9ptZVFhQ2h6QcyFgcp5UaDyst0jED7wCn5w6kxQ,2313
@@ -9,10 +9,10 @@ pynintendoparental/exceptions.py,sha256=5M3y0OLSRvX9Ly8D4981HqiKTNxxVqeyzPIuAekQ
9
9
  pynintendoparental/player.py,sha256=n0wabGjCZumVT84sL8_Wag738A7OQlPnnL1H49U64Bg,1713
10
10
  pynintendoparental/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  pynintendoparental/utils.py,sha256=5-EP_rmPnSSWtbi18Y226GtjLhF3PLONKwmRdiy7m2c,198
12
- pynintendoparental/authenticator/__init__.py,sha256=YBKrssYkirAI_PgrCRNEGWmfUryjfrAuiRa2zWRs0_w,7291
12
+ pynintendoparental/authenticator/__init__.py,sha256=GjqTMdm5ROca-baSAaiGyz4S0sc0mSzkKiPbvyWCArg,7525
13
13
  pynintendoparental/authenticator/const.py,sha256=4QhojJ_dTAFwlS9LPnRxm6wWc_wjrme8cICvMnKGwVE,823
14
- pynintendoparental-0.7.1.dist-info/licenses/LICENSE,sha256=zsxHgHVMnyWq121yND8zBl9Rl9H6EF2K9N51B2ZSm_k,1071
15
- pynintendoparental-0.7.1.dist-info/METADATA,sha256=yCMn8Y8wCRVu6DjSvGRtlKHs2XlIR6oT9Ow0E41VGuw,1871
16
- pynintendoparental-0.7.1.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
17
- pynintendoparental-0.7.1.dist-info/top_level.txt,sha256=QQ5bAl-Ljso16P8KLf1NHrFmKk9jLT7bVJG_rVlIXWk,19
18
- pynintendoparental-0.7.1.dist-info/RECORD,,
14
+ pynintendoparental-0.7.2.dist-info/licenses/LICENSE,sha256=zsxHgHVMnyWq121yND8zBl9Rl9H6EF2K9N51B2ZSm_k,1071
15
+ pynintendoparental-0.7.2.dist-info/METADATA,sha256=KbPGq9TANdo0-iW1XubeNtHbS6kzFzY1uNYeB0YsHW8,1871
16
+ pynintendoparental-0.7.2.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
17
+ pynintendoparental-0.7.2.dist-info/top_level.txt,sha256=QQ5bAl-Ljso16P8KLf1NHrFmKk9jLT7bVJG_rVlIXWk,19
18
+ pynintendoparental-0.7.2.dist-info/RECORD,,