Skip to content

Commit

Permalink
change asycio loop to uvloop
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulunair committed Feb 15, 2021
1 parent c16da2b commit 4a23d29
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/repo_peek/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
from pathlib import Path
import shutil
import uvloop

from .logging import logger
from .config import Config
Expand All @@ -13,6 +14,9 @@
from .utils import extract


uvloop.install()


async def open_editor(editor="vim", path: Path = Path("")):
"""open editor with source."""
editor = os.getenv("EDITOR", editor)
Expand Down Expand Up @@ -46,6 +50,7 @@ async def peek_repo(repo: str, service="github", cache=False):
if not cache:
rm_stored_repos(cache_dir)
repo_dir = init_dir(cache_dir / "repos" / repo)
# readme_path = await readme_from_cdn(repo, repo_dir)
if os.path.isdir(repo_dir) and os.listdir(repo_dir):
await open_editor(path=repo_dir)
else:
Expand All @@ -72,5 +77,4 @@ async def peek_repo(repo: str, service="github", cache=False):


def main(repo="rahulunair/cloudstore", service="github"):
loop = asyncio.get_event_loop()
loop.run_until_complete(peek_repo(repo, service))
asyncio.run(peek_repo(repo, service))

0 comments on commit 4a23d29

Please sign in to comment.