Skip to content

[MAN-1191] feat: Defining logic about files and interactive menu #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

JulioVazquezA
Copy link
Collaborator

@JulioVazquezA JulioVazquezA commented Jul 11, 2024

Ticket

MAN-1191

Descripción

Añadimos la lógica de la carga de documentos, el manejo de los mismos y la creación de carpetas dado el formato correcto.

Checklist

  • [ ✅ ] He probado en mi máquina local y en el entorno de pruebas (Staging)
  • [ ✅ ] He actualizado o creado la documentación. En caso de ser necesario

Summary by CodeRabbit

  • New Features

    • Introduced a project for automating document uploads in documents_upload.
    • Added functionality to manage connections to a database.
    • Implemented document management with validation and organization based on plate information.
    • Enhanced querying capabilities with new methods for account details.
    • Added a terminal interface for user interaction.
  • Documentation

    • Updated .gitignore to ignore unnecessary files.
    • Added README.md with project details and endpoint information.

Copy link

coderabbitai bot commented Jul 11, 2024

Walkthrough

The update introduces automation for uploading customer document files via a new project within the documents_upload directory. This includes new classes for database connection (Connection), document handling (Document), query execution (Query), and terminal interaction (Terminal). Additionally, new files and rules are added to .gitignore to manage unnecessary files and directories. A README file explains the purpose and usage of the project.

Changes

Files Change Summary
.gitignore, documents_upload/.gitignore Updated to ignore .DS_Store files and files/ directory.
documents_upload/README.md Introduced to explain the project for automating document uploads, including endpoint details and further references.
documents_upload/src/conection.py Added Connection class with methods for managing database connectivity and transactions.
documents_upload/src/document.py Added Document class and related functions for handling document data, including validation and organization based on plates.
documents_upload/src/main.py Implemented logic for processing, categorizing, and managing documents in the main execution flow.
documents_upload/src/query.py Added Query class with methods to execute queries and retrieve account details by name or legacy code.
documents_upload/src/terminal.py Added Terminal class to manage terminal interface interactions for retrieving logos and prompting account names.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Terminal
    participant Document
    participant Query
    participant Connection

    User->>+Terminal: Start Process
    Terminal->>User: Prompt Account Name
    User->>Terminal: Enter Account Name
    Terminal->>Query: Retrieve Account Details
    Query->>Connection: Execute Query
    Connection->>Query: Return Results
    Query->>Terminal: Account Details
    Terminal->>Document: Process Documents
    Document->>Document: Validate & Categorize Documents
    Document->>Document: Display Document Info
    Document->>Document: Move Documents to Folders
    Document->>Terminal: Completion Message
    Terminal->>User: Process Completed
Loading

Poem

In the land of code, where documents fly,
A rabbit hops quickly, beneath a clear sky.
"Connect and query," it whispers with grace,
"Organize files, in their proper place."
With terminal prompt and the documents' lore,
Automation magic opens many a door. 🚀✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 8

Outside diff range, codebase verification and nitpick comments (4)
documents_upload/src/document.py (4)

24-28: Enhance the clean_plate function to handle edge cases.

Consider handling cases where the input plate is None or an empty string more explicitly.

+  if plate is None:
+      return "NO PLATE FOR FILE"

30-36: Handle cases where the directory does not exist or is empty.

Consider adding error handling if the directory does not exist or is empty.

+  if not os.path.exists(path):
+      raise FileNotFoundError(f"The directory {path} does not exist.")

38-43: Handle cases where the document list is empty.

Consider adding a check to handle cases where the document list is empty.

+  if not documents:
+      print("No documents found.")
+      return

79-91: Handle cases where the directory does not exist or contains no folders.

Consider adding error handling if the directory does not exist or contains no folders.

+  if not os.path.exists(base_path):
+      raise FileNotFoundError(f"The directory {base_path} does not exist.")
+  if not os.listdir(base_path):
+      print("No folders found.")
+      return plates
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 461dea5 and 85f4b12.

Files selected for processing (8)
  • .gitignore (1 hunks)
  • documents_upload/.gitignore (1 hunks)
  • documents_upload/README.md (1 hunks)
  • documents_upload/src/conection.py (1 hunks)
  • documents_upload/src/document.py (1 hunks)
  • documents_upload/src/main.py (1 hunks)
  • documents_upload/src/query.py (1 hunks)
  • documents_upload/src/terminal.py (1 hunks)
Files skipped from review due to trivial changes (3)
  • .gitignore
  • documents_upload/.gitignore
  • documents_upload/README.md
Additional context used
Ruff
documents_upload/src/main.py

1-1: from document import * used; unable to detect undefined names

(F403)


2-2: from query import * used; unable to detect undefined names

(F403)


3-3: from conection import * used; unable to detect undefined names

(F403)


4-4: from terminal import * used; unable to detect undefined names

(F403)


8-8: get_documents_from_files may be undefined, or defined from star imports

(F405)


19-19: Terminal may be undefined, or defined from star imports

(F405)


21-21: Terminal may be undefined, or defined from star imports

(F405)


24-24: print_document_info may be undefined, or defined from star imports

(F405)


27-27: print_document_info may be undefined, or defined from star imports

(F405)


29-29: create_and_move_documents may be undefined, or defined from star imports

(F405)


31-31: create_and_move_documents may be undefined, or defined from star imports

(F405)


33-33: get_plate_by_folder_name may be undefined, or defined from star imports

(F405)


38-38: Query may be undefined, or defined from star imports

(F405)


38-38: Query may be undefined, or defined from star imports

(F405)

Additional comments not posted (13)
documents_upload/src/query.py (2)

4-6: Constructor looks good!

The constructor correctly initializes the query attribute.


13-14: String representation looks good!

The __str__ method correctly returns the query string.

documents_upload/src/conection.py (3)

10-16: Constructor looks good!

The constructor correctly initializes the database connection parameters.


27-30: Cursor method looks good!

The cursor method correctly checks for a connection before returning a cursor.


32-35: Commit method looks good!

The commit method correctly checks for a connection before committing.

documents_upload/src/main.py (2)

8-8: Ensure get_documents_from_files is defined.

The function get_documents_from_files must be defined in the imported modules.

Verification successful

Verification successful. The function get_documents_from_files is defined in the codebase.

  • Location: documents_upload/src/document.py
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify `get_documents_from_files` function is defined in the imported modules.

# Test: Search for the function definition. Expect: Function definition found in the appropriate module.
rg --type python -A 1 $'def get_documents_from_files'

Length of output: 85


Script:

#!/bin/bash
# Description: Verify `get_documents_from_files` function is defined in the imported modules.

# Test: Search for the function definition using rg.
rg --type py -A 1 $'def get_documents_from_files'

# Test: Search for the function definition using ast-grep.
ast-grep --lang python --pattern $'def get_documents_from_files($_):'

Length of output: 242

Tools
Ruff

8-8: get_documents_from_files may be undefined, or defined from star imports

(F405)


38-41: Ensure Query is defined.

The class Query must be defined in the imported modules.

Verification successful

Verification successful: Query class is properly defined and imported.

The Query class is defined in documents_upload/src/query.py and is imported in documents_upload/src/main.py using from query import *.

  • documents_upload/src/query.py:class Query
  • documents_upload/src/main.py:from query import *
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify `Query` class is defined in the imported modules.

# Test: Search for the class definition. Expect: Class definition found in the appropriate module.
rg --type python -A 1 $'class Query'

Length of output: 68


Script:

#!/bin/bash
# Description: Verify `Query` class is defined in the imported modules.

# Test: Search for the class definition. Expect: Class definition found in the appropriate module.
rg --type py -A 1 $'class Query'

Length of output: 107


Script:

#!/bin/bash
# Description: Verify `Query` is imported in documents_upload/src/main.py

# Test: Search for the import statement. Expect: Query is imported in the module.
rg --type py 'import Query' documents_upload/src/main.py

Length of output: 58


Script:

#!/bin/bash
# Description: Verify all import statements in documents_upload/src/main.py

# Test: List all import statements. Expect: Identify if the module containing Query is imported.
rg --type py '^import ' documents_upload/src/main.py
rg --type py '^from ' documents_upload/src/main.py

Length of output: 197

Tools
Ruff

38-38: Query may be undefined, or defined from star imports

(F405)


38-38: Query may be undefined, or defined from star imports

(F405)

documents_upload/src/terminal.py (1)

35-37: Prompt for account name method looks good!

The method correctly prompts for an account name or legacy code.

documents_upload/src/document.py (5)

8-9: Constructor looks good.

The constructor initializes the name attribute correctly.


11-12: Method get_plate looks good.

The method correctly splits the name attribute to retrieve the plate.


14-15: Method get_type looks good.

The method correctly splits the name attribute to retrieve the file type and converts it to uppercase.


17-18: Method __str__ looks good.

The method provides a string representation of the Document object.


20-22: Method is_valid_plate looks good.

The method validates the plate using the clean_plate function and checks if it is alphanumeric.

Comment on lines +18 to +19
def get_account_name(name):
return f"""SELECT a.id, a.legacy_account_id, a.name FROM accounts a WHERE a.name = '{name}';"""
Copy link

Choose a reason for hiding this comment

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

Potential SQL injection risk.

The get_account_name method directly interpolates the name parameter into the SQL query, which could lead to SQL injection attacks. Use parameterized queries instead.

@staticmethod
def get_account_name(name):
    return f"SELECT a.id, a.legacy_account_id, a.name FROM accounts a WHERE a.name = %s;", (name,)

Committable suggestion was skipped due to low confidence.

Comment on lines +8 to +10
def execute(self):
print(f"Executing query: {self.query}")
return True
Copy link

Choose a reason for hiding this comment

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

Add proper error handling for the execute method.

The execute method currently only prints the query. It should handle possible database execution errors.

def execute(self):
    try:
        print(f"Executing query: {self.query}")
        # Add actual database execution logic here
        return True
    except Exception as e:
        print(f"An error occurred: {e}")
        return False
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
def execute(self):
print(f"Executing query: {self.query}")
return True
def execute(self):
try:
print(f"Executing query: {self.query}")
# Add actual database execution logic here
return True
except Exception as e:
print(f"An error occurred: {e}")
return False

Comment on lines +23 to +24
def get_account_legacy_code(legacy_code):
return f"""SELECT a.id, a.legacy_account_id, a.legacy_code FROM accounts a WHERE a.legacy_code = '{legacy_code}';"""
Copy link

Choose a reason for hiding this comment

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

Potential SQL injection risk.

The get_account_legacy_code method directly interpolates the legacy_code parameter into the SQL query, which could lead to SQL injection attacks. Use parameterized queries instead.

@staticmethod
def get_account_legacy_code(legacy_code):
    return f"SELECT a.id, a.legacy_account_id, a.legacy_code FROM accounts a WHERE a.legacy_code = %s;", (legacy_code,)
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
def get_account_legacy_code(legacy_code):
return f"""SELECT a.id, a.legacy_account_id, a.legacy_code FROM accounts a WHERE a.legacy_code = '{legacy_code}';"""
@staticmethod
def get_account_legacy_code(legacy_code):
return "SELECT a.id, a.legacy_account_id, a.legacy_code FROM accounts a WHERE a.legacy_code = %s;", (legacy_code,)

Comment on lines +18 to +25
def connect(self):
self.conn = psycopg2.connect(
database=self.db_name,
host=self.host,
user=self.user,
password=self.password,
port=self.port
)
Copy link

Choose a reason for hiding this comment

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

Add error handling for the connect method.

The connect method should handle possible connection errors.

def connect(self):
    try:
        self.conn = psycopg2.connect(
            database=self.db_name,
            host=self.host,
            user=self.user,
            password=self.password,
            port=self.port
        )
    except psycopg2.DatabaseError as e:
        print(f"Database connection error: {e}")
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
def connect(self):
self.conn = psycopg2.connect(
database=self.db_name,
host=self.host,
user=self.user,
password=self.password,
port=self.port
)
def connect(self):
try:
self.conn = psycopg2.connect(
database=self.db_name,
host=self.host,
user=self.user,
password=self.password,
port=self.port
)
except psycopg2.DatabaseError as e:
print(f"Database connection error: {e}")

Comment on lines +45 to +77
def create_and_move_documents(documents, base_path):
invalid_folder_path = os.path.join(base_path, 'invalid-documents')

if not os.path.exists(invalid_folder_path):
os.makedirs(invalid_folder_path)

for doc in documents:
src = os.path.join(base_path, doc.name)
plate = clean_plate(doc.get_plate())

print(f"Processing {doc.name}: Plate = {plate}, is_valid = {doc.is_valid_plate()}")

if doc.is_valid_plate():
folder_path = os.path.join(base_path, plate)

if not os.path.exists(folder_path):
os.makedirs(folder_path)

dst = os.path.join(folder_path, doc.name)

if os.path.exists(src):
shutil.copy(src, dst)
print(f"Copied {doc.name} to {folder_path}")
else:
print(f"Source file {src} does not exist")
else:
dst = os.path.join(invalid_folder_path, doc.name)

if os.path.exists(src):
shutil.copy(src, dst)
print(f"Copied {doc.name} to {invalid_folder_path}")
else:
print(f"Source file {src} does not exist")
Copy link

Choose a reason for hiding this comment

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

Consider refactoring the create_and_move_documents function.

The function has multiple responsibilities and can be refactored to improve readability and maintainability.

-  def create_and_move_documents(documents, base_path):
-      invalid_folder_path = os.path.join(base_path, 'invalid-documents')
-      if not os.path.exists(invalid_folder_path):
-          os.makedirs(invalid_folder_path)
-  
-      for doc in documents:
-          src = os.path.join(base_path, doc.name)
-          plate = clean_plate(doc.get_plate())
-          print(f"Processing {doc.name}: Plate = {plate}, is_valid = {doc.is_valid_plate()}")
-          if doc.is_valid_plate():
-              folder_path = os.path.join(base_path, plate)
-              if not os.path.exists(folder_path):
-                  os.makedirs(folder_path)
-              dst = os.path.join(folder_path, doc.name)
-              if os.path.exists(src):
-                  shutil.copy(src, dst)
-                  print(f"Copied {doc.name} to {folder_path}")
-              else:
-                  print(f"Source file {src} does not exist")
-          else:
-              dst = os.path.join(invalid_folder_path, doc.name)
-              if os.path.exists(src):
-                  shutil.copy(src, dst)
-                  print(f"Copied {doc.name} to {invalid_folder_path}")
-              else:
-                  print(f"Source file {src} does not exist")

+  def create_and_move_documents(documents, base_path):
+      def create_folder_if_not_exists(folder_path):
+          if not os.path.exists(folder_path):
+              os.makedirs(folder_path)
+
+      def copy_document(src, dst):
+          if os.path.exists(src):
+              shutil.copy(src, dst)
+              print(f"Copied {os.path.basename(src)} to {dst}")
+          else:
+              print(f"Source file {src} does not exist")
+
+      invalid_folder_path = os.path.join(base_path, 'invalid-documents')
+      create_folder_if_not_exists(invalid_folder_path)
+
+      for doc in documents:
+          src = os.path.join(base_path, doc.name)
+          plate = clean_plate(doc.get_plate())
+          print(f"Processing {doc.name}: Plate = {plate}, is_valid = {doc.is_valid_plate()}")
+          if doc.is_valid_plate():
+              folder_path = os.path.join(base_path, plate)
+              create_folder_if_not_exists(folder_path)
+              dst = os.path.join(folder_path, doc.name)
+          else:
+              dst = os.path.join(invalid_folder_path, doc.name)
+          copy_document(src, dst)
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
def create_and_move_documents(documents, base_path):
invalid_folder_path = os.path.join(base_path, 'invalid-documents')
if not os.path.exists(invalid_folder_path):
os.makedirs(invalid_folder_path)
for doc in documents:
src = os.path.join(base_path, doc.name)
plate = clean_plate(doc.get_plate())
print(f"Processing {doc.name}: Plate = {plate}, is_valid = {doc.is_valid_plate()}")
if doc.is_valid_plate():
folder_path = os.path.join(base_path, plate)
if not os.path.exists(folder_path):
os.makedirs(folder_path)
dst = os.path.join(folder_path, doc.name)
if os.path.exists(src):
shutil.copy(src, dst)
print(f"Copied {doc.name} to {folder_path}")
else:
print(f"Source file {src} does not exist")
else:
dst = os.path.join(invalid_folder_path, doc.name)
if os.path.exists(src):
shutil.copy(src, dst)
print(f"Copied {doc.name} to {invalid_folder_path}")
else:
print(f"Source file {src} does not exist")
def create_and_move_documents(documents, base_path):
def create_folder_if_not_exists(folder_path):
if not os.path.exists(folder_path):
os.makedirs(folder_path)
def copy_document(src, dst):
if os.path.exists(src):
shutil.copy(src, dst)
print(f"Copied {os.path.basename(src)} to {dst}")
else:
print(f"Source file {src} does not exist")
invalid_folder_path = os.path.join(base_path, 'invalid-documents')
create_folder_if_not_exists(invalid_folder_path)
for doc in documents:
src = os.path.join(base_path, doc.name)
plate = clean_plate(doc.get_plate())
print(f"Processing {doc.name}: Plate = {plate}, is_valid = {doc.is_valid_plate()}")
if doc.is_valid_plate():
folder_path = os.path.join(base_path, plate)
create_folder_if_not_exists(folder_path)
dst = os.path.join(folder_path, doc.name)
else:
dst = os.path.join(invalid_folder_path, doc.name)
copy_document(src, dst)

Comment on lines +1 to +4
from document import *
from query import *
from conection import *
from terminal import *
Copy link

Choose a reason for hiding this comment

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

Avoid wildcard imports.

Wildcard imports can lead to namespace pollution and make it difficult to track the origin of imported names. Import only what is necessary.

from document import (
    get_documents_from_files,
    print_document_info,
    create_and_move_documents,
    get_plate_by_folder_name
)
from query import Query
from conection import Connection
from terminal import Terminal
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
from document import *
from query import *
from conection import *
from terminal import *
from document import (
get_documents_from_files,
print_document_info,
create_and_move_documents,
get_plate_by_folder_name
)
from query import Query
from conection import Connection
from terminal import Terminal
Tools
Ruff

1-1: from document import * used; unable to detect undefined names

(F403)


2-2: from query import * used; unable to detect undefined names

(F403)


3-3: from conection import * used; unable to detect undefined names

(F403)


4-4: from terminal import * used; unable to detect undefined names

(F403)

Comment on lines +19 to +21
print(Terminal.get_logo())

nombre_cuenta = Terminal.account_name()
Copy link

Choose a reason for hiding this comment

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

Fix the method call to prompt_for_account_name.

The method prompt_for_account_name should be called instead of account_name.

print(Terminal.get_logo())

nombre_cuenta = Terminal.prompt_for_account_name()
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
print(Terminal.get_logo())
nombre_cuenta = Terminal.account_name()
print(Terminal.get_logo())
nombre_cuenta = Terminal.prompt_for_account_name()
Tools
Ruff

19-19: Terminal may be undefined, or defined from star imports

(F405)


21-21: Terminal may be undefined, or defined from star imports

(F405)

Comment on lines +8 to +33
def get_logo():
return r"""
_,--._
,' `.
|\ / ,-. ,-. \ /|
)o),/ ( ( o )( o ) ) \.(o(
/o/// /| `-' `-' |\ \\\o\
/ / |\ \( . , )/ /| \ \
| | \o`-/ `\/' \-'o/ | |
\ \ `,' `.' / /
\. \ `-' ,'| /\ |`. `-' / ,/
\`. `.__,' / / \ \ `.__,' ,'/
\o\ ,' ,' `. `. /o/
\o`---' ,' `. `---'o/
`.____,' `.____,'

_____ _ _ _ _ _
| __ \ | | | | | | | | | |
| | | | ___ ___ _ _ _ __ ___ ___ _ __ | |_ ___ | | | |_ __ | | ___ __ _ __| |
| | | |/ _ \ / __| | | | '_ ` _ \ / _ | '_ \| __/ __| | | | | '_ \| |/ _ \ / _` |/ _` |
| |__| | (_) | (__| |_| | | | | | | __| | | | |_\__ \ | |__| | |_) | | (_) | (_| | (_| |
|_____/ \___/ \___|\__,_|_| |_| |_|\___|_| |_|\__|___/ \____/| .__/|_|\___/ \__,_|\__,_|
| |
|_|

"""
Copy link

Choose a reason for hiding this comment

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

Add self parameter to the get_logo method.

The get_logo method is missing the self parameter.

def get_logo(self):
    return r"""
                        _,--._
                      ,'      `.
              |\     / ,-.  ,-. \     /|
              )o),/ ( ( o )( o ) ) \.(o(
             /o/// /|  `-'  `-'  |\ \\\o\
            / / |\ \(   .    ,   )/ /| \ \
            | | \o`-/    `\/'    \-'o/ | |
            \ \  `,'              `.'  / /
         \.  \ `-'  ,'|   /\   |`.  `-' /  ,/
          \`. `.__,' /   /  \   \ `.__,' ,'/
           \o\     ,'  ,'    `.  `.     /o/
            \o`---'  ,'        `.  `---'o/
             `.____,'            `.____,'

  _____                                        _         _    _       _                 _ 
 |  __ \                                      | |       | |  | |     | |               | |
 | |  | | ___   ___ _   _ _ __ ___   ___ _ __ | |_ ___  | |  | |_ __ | | ___   __ _  __| |
 | |  | |/ _ \ / __| | | | '_ ` _ \ / _ | '_ \| __/ __| | |  | | '_ \| |/ _ \ / _` |/ _` |
 | |__| | (_) | (__| |_| | | | | | |  __| | | | |_\__ \ | |__| | |_) | | (_) | (_| | (_| |
 |_____/ \___/ \___|\__,_|_| |_| |_|\___|_| |_|\__|___/  \____/| .__/|_|\___/ \__,_|\__,_|
                                                               | |                        
                                                               |_|                        
"""
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
def get_logo():
return r"""
_,--._
,' `.
|\ / ,-. ,-. \ /|
)o),/ ( ( o )( o ) ) \.(o(
/o/// /| `-' `-' |\ \\\o\
/ / |\ \( . , )/ /| \ \
| | \o`-/ `\/' \-'o/ | |
\ \ `,' `.' / /
\. \ `-' ,'| /\ |`. `-' / ,/
\`. `.__,' / / \ \ `.__,' ,'/
\o\ ,' ,' `. `. /o/
\o`---' ,' `. `---'o/
`.____,' `.____,'
_____ _ _ _ _ _
| __ \ | | | | | | | | | |
| | | | ___ ___ _ _ _ __ ___ ___ _ __ | |_ ___ | | | |_ __ | | ___ __ _ __| |
| | | |/ _ \ / __| | | | '_ ` _ \ / _ | '_ \| __/ __| | | | | '_ \| |/ _ \ / _` |/ _` |
| |__| | (_) | (__| |_| | | | | | | __| | | | |_\__ \ | |__| | |_) | | (_) | (_| | (_| |
|_____/ \___/ \___|\__,_|_| |_| |_|\___|_| |_|\__|___/ \____/| .__/|_|\___/ \__,_|\__,_|
| |
|_|
"""
def get_logo(self):
return r"""
_,--._
,' `.
|\ / ,-. ,-. \ /|
)o),/ ( ( o )( o ) ) \.(o(
/o/// /| `-' `-' |\ \\\o\
/ / |\ \( . , )/ /| \ \
| | \o`-/ `\/' \-'o/ | |
\ \ `,' `.' / /
\. \ `-' ,'| /\ |`. `-' / ,/
\`. `.__,' / / \ \ `.__,' ,'/
\o\ ,' ,' `. `. /o/
\o`---' ,' `. `---'o/
`.____,' `.____,'
_____ _ _ _ _ _
| __ \ | | | | | | | | | |
| | | | ___ ___ _ _ _ __ ___ ___ _ __ | |_ ___ | | | |_ __ | | ___ __ _ __| |
| | | |/ _ \ / __| | | | '_ ` _ \ / _ | '_ \| __/ __| | | | | '_ \| |/ _ \ / _` |/ _` |
| |__| | (_) | (__| |_| | | | | | | __| | | | |_\__ \ | |__| | |_) | | (_) | (_| | (_| |
|_____/ \___/ \___|\__,_|_| |_| |_|\___|_| |_|\__|___/ \____/| .__/|_|\___/ \__,_|\__,_|
| |
|_|
"""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant