Skip to content

Commit

Permalink
prep for release, regen docs
Browse files Browse the repository at this point in the history
  • Loading branch information
carlmontanari committed Jul 26, 2022
1 parent 9642231 commit 4813711
Show file tree
Hide file tree
Showing 17 changed files with 690 additions and 1,079 deletions.
36 changes: 15 additions & 21 deletions docs/api_docs/channel/async_channel.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,13 @@ scrapli.channel.async_channel
import asyncio
import re
import time
from io import BytesIO

try:
from contextlib import asynccontextmanager
except ImportError: # pragma: nocover
# needed for 3.6 support, no asynccontextmanager until 3.7
from async_generator import asynccontextmanager # type: ignore # pragma: nocover

from contextlib import asynccontextmanager
from datetime import datetime
from io import BytesIO
from typing import AsyncIterator, List, Optional, Tuple

from scrapli.channel.base_channel import BaseChannel, BaseChannelArgs
from scrapli.decorators import ChannelTimeout
from scrapli.decorators import timeout_wrapper
from scrapli.exceptions import ScrapliAuthenticationFailed, ScrapliTimeout
from scrapli.transport.base import AsyncTransport

Expand Down Expand Up @@ -290,7 +284,7 @@ class AsyncChannel(BaseChannel):

return read_buf.getvalue()

@ChannelTimeout(message="timed out during in channel ssh authentication")
@timeout_wrapper
async def channel_authenticate_ssh(
self, auth_password: str, auth_private_key_passphrase: str
) -> None:
Expand Down Expand Up @@ -363,7 +357,7 @@ class AsyncChannel(BaseChannel):
):
return

@ChannelTimeout(message="timed out during in channel telnet authentication")
@timeout_wrapper
async def channel_authenticate_telnet( # noqa: C901
self, auth_username: str = "", auth_password: str = ""
) -> None:
Expand Down Expand Up @@ -450,7 +444,7 @@ class AsyncChannel(BaseChannel):
):
return

@ChannelTimeout(message="timed out getting prompt")
@timeout_wrapper
async def get_prompt(self) -> str:
"""
Get current channel prompt
Expand Down Expand Up @@ -486,7 +480,7 @@ class AsyncChannel(BaseChannel):
current_prompt = channel_match.group(0)
return current_prompt.decode().strip()

@ChannelTimeout(message="timed out sending input to device")
@timeout_wrapper
async def send_input(
self,
channel_input: str,
Expand Down Expand Up @@ -534,7 +528,7 @@ class AsyncChannel(BaseChannel):
)
return buf, processed_buf

@ChannelTimeout(message="timed out sending input to device")
@timeout_wrapper
async def send_input_and_read(
self,
channel_input: str,
Expand Down Expand Up @@ -589,7 +583,7 @@ class AsyncChannel(BaseChannel):

return buf, processed_buf

@ChannelTimeout(message="timed out sending interactive input to device")
@timeout_wrapper
async def send_inputs_interact(
self,
interact_events: List[Tuple[str, str, Optional[bool]]],
Expand Down Expand Up @@ -970,7 +964,7 @@ class AsyncChannel(BaseChannel):

return read_buf.getvalue()

@ChannelTimeout(message="timed out during in channel ssh authentication")
@timeout_wrapper
async def channel_authenticate_ssh(
self, auth_password: str, auth_private_key_passphrase: str
) -> None:
Expand Down Expand Up @@ -1043,7 +1037,7 @@ class AsyncChannel(BaseChannel):
):
return

@ChannelTimeout(message="timed out during in channel telnet authentication")
@timeout_wrapper
async def channel_authenticate_telnet( # noqa: C901
self, auth_username: str = "", auth_password: str = ""
) -> None:
Expand Down Expand Up @@ -1130,7 +1124,7 @@ class AsyncChannel(BaseChannel):
):
return

@ChannelTimeout(message="timed out getting prompt")
@timeout_wrapper
async def get_prompt(self) -> str:
"""
Get current channel prompt
Expand Down Expand Up @@ -1166,7 +1160,7 @@ class AsyncChannel(BaseChannel):
current_prompt = channel_match.group(0)
return current_prompt.decode().strip()

@ChannelTimeout(message="timed out sending input to device")
@timeout_wrapper
async def send_input(
self,
channel_input: str,
Expand Down Expand Up @@ -1214,7 +1208,7 @@ class AsyncChannel(BaseChannel):
)
return buf, processed_buf

@ChannelTimeout(message="timed out sending input to device")
@timeout_wrapper
async def send_input_and_read(
self,
channel_input: str,
Expand Down Expand Up @@ -1269,7 +1263,7 @@ class AsyncChannel(BaseChannel):

return buf, processed_buf

@ChannelTimeout(message="timed out sending interactive input to device")
@timeout_wrapper
async def send_inputs_interact(
self,
interact_events: List[Tuple[str, str, Optional[bool]]],
Expand Down
26 changes: 13 additions & 13 deletions docs/api_docs/channel/sync_channel.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ from threading import Lock
from typing import Iterator, List, Optional, Tuple

from scrapli.channel.base_channel import BaseChannel, BaseChannelArgs
from scrapli.decorators import ChannelTimeout
from scrapli.decorators import timeout_wrapper
from scrapli.exceptions import ScrapliAuthenticationFailed, ScrapliTimeout
from scrapli.transport.base import Transport

Expand Down Expand Up @@ -281,7 +281,7 @@ class Channel(BaseChannel):

return read_buf.getvalue()

@ChannelTimeout(message="timed out during in channel ssh authentication")
@timeout_wrapper
def channel_authenticate_ssh(
self, auth_password: str, auth_private_key_passphrase: str
) -> None:
Expand Down Expand Up @@ -353,7 +353,7 @@ class Channel(BaseChannel):
):
return

@ChannelTimeout(message="timed out during in channel telnet authentication")
@timeout_wrapper
def channel_authenticate_telnet(self, auth_username: str = "", auth_password: str = "") -> None:
"""
Handle Telnet Authentication
Expand Down Expand Up @@ -434,7 +434,7 @@ class Channel(BaseChannel):
):
return

@ChannelTimeout(message="timed out getting prompt")
@timeout_wrapper
def get_prompt(self) -> str:
"""
Get current channel prompt
Expand Down Expand Up @@ -470,7 +470,7 @@ class Channel(BaseChannel):
current_prompt = channel_match.group(0)
return current_prompt.decode().strip()

@ChannelTimeout(message="timed out sending input to device")
@timeout_wrapper
def send_input(
self,
channel_input: str,
Expand Down Expand Up @@ -518,7 +518,7 @@ class Channel(BaseChannel):
)
return buf, processed_buf

@ChannelTimeout(message="timed out sending input to device")
@timeout_wrapper
def send_input_and_read(
self,
channel_input: str,
Expand Down Expand Up @@ -573,7 +573,7 @@ class Channel(BaseChannel):

return buf, processed_buf

@ChannelTimeout(message="timed out sending interactive input to device")
@timeout_wrapper
def send_inputs_interact(
self,
interact_events: List[Tuple[str, str, Optional[bool]]],
Expand Down Expand Up @@ -951,7 +951,7 @@ class Channel(BaseChannel):

return read_buf.getvalue()

@ChannelTimeout(message="timed out during in channel ssh authentication")
@timeout_wrapper
def channel_authenticate_ssh(
self, auth_password: str, auth_private_key_passphrase: str
) -> None:
Expand Down Expand Up @@ -1023,7 +1023,7 @@ class Channel(BaseChannel):
):
return

@ChannelTimeout(message="timed out during in channel telnet authentication")
@timeout_wrapper
def channel_authenticate_telnet(self, auth_username: str = "", auth_password: str = "") -> None:
"""
Handle Telnet Authentication
Expand Down Expand Up @@ -1104,7 +1104,7 @@ class Channel(BaseChannel):
):
return

@ChannelTimeout(message="timed out getting prompt")
@timeout_wrapper
def get_prompt(self) -> str:
"""
Get current channel prompt
Expand Down Expand Up @@ -1140,7 +1140,7 @@ class Channel(BaseChannel):
current_prompt = channel_match.group(0)
return current_prompt.decode().strip()

@ChannelTimeout(message="timed out sending input to device")
@timeout_wrapper
def send_input(
self,
channel_input: str,
Expand Down Expand Up @@ -1188,7 +1188,7 @@ class Channel(BaseChannel):
)
return buf, processed_buf

@ChannelTimeout(message="timed out sending input to device")
@timeout_wrapper
def send_input_and_read(
self,
channel_input: str,
Expand Down Expand Up @@ -1243,7 +1243,7 @@ class Channel(BaseChannel):

return buf, processed_buf

@ChannelTimeout(message="timed out sending interactive input to device")
@timeout_wrapper
def send_inputs_interact(
self,
interact_events: List[Tuple[str, str, Optional[bool]]],
Expand Down
Loading

0 comments on commit 4813711

Please sign in to comment.