Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
atick-faisal committed Apr 30, 2024
1 parent 5a791ec commit ba31487
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
3 changes: 2 additions & 1 deletion peter_explains/args.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys, argparse
import sys
import argparse

from peter_explains.api_key import GoogleApiKey
from peter_explains.cache import PeterCache
Expand Down
21 changes: 11 additions & 10 deletions peter_explains/cache.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os, sys
import os
import sys
from diskcache import Cache


Expand Down Expand Up @@ -32,20 +33,20 @@ def get_cache_dir(app_name) -> str:
)
else:
cache_dir = os.path.join(home, ".config", app_name, "cache")

return cache_dir

def __contains__(self, key):
"""
Check if the cache contains a specific key.
"""
Check if the cache contains a specific key.
Args:
key: The key to check.
Args:
key: The key to check.
Returns:
True if the cache contains the key, False otherwise.
"""
return key in self.cache
Returns:
True if the cache contains the key, False otherwise.
"""
return key in self.cache

def save(self, key, value):
"""
Expand Down
2 changes: 2 additions & 0 deletions peter_explains/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class CommandExplanation:
options: list[str]
examples: list[str]

@staticmethod
def from_response(response: str) -> "CommandExplanation":
"""
Creates a CommandExplanation object from a response string.
Expand Down Expand Up @@ -59,6 +60,7 @@ class CommandExplanationWithArguments:
purpose: str
breakdown: list[str]

@staticmethod
def from_response(response: str) -> "CommandExplanationWithArguments":
"""
Creates a CommandExplanationWithArguments object from a response string.
Expand Down
4 changes: 2 additions & 2 deletions peter_explains/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ def show_peter_help():
+ "* --api [API_KEY]: Gotta do it before doin anythihg stupid."
+ Style.RESET_ALL
)
print("* --clear-api: Screwd up API key? Go remove it it with this. You're welcome.")
print("* --clear-cache: Wanna start fresh? Try this one.")
print("* --delete-api: Screwd up API key? Go remove it it with this. You're welcome.")
print("* --delete-cache: Wanna start fresh? Try this one.")
print("* --help: Yeah, yeah, that's what you're lookin' at right now, genius.")
print(
"* --version: Who cares what version this is? It ain't gonna work right anyway.\n"
Expand Down

0 comments on commit ba31487

Please sign in to comment.