Skip to content

Commit

Permalink
return something for terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
ZihengSun committed Feb 3, 2024
1 parent 63585b0 commit 22e8110
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pygeoweaver/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def get_process_by_name_command(process_name):
:param process_name: The name of the process.
:type process_name: str
"""
get_process_by_name(process_name)
return get_process_by_name(process_name)


@find_command.command("id")
Expand All @@ -228,7 +228,7 @@ def get_process_by_id_command(process_id):
:param process_id: The ID of the process.
:type process_id: str
"""
get_process_by_id(process_id)
return get_process_by_id(process_id)


@find_command.command("language")
Expand All @@ -240,7 +240,7 @@ def get_process_by_language_command(language):
:param language: The programming language of the processes.
:type language: str
"""
get_process_by_language(language)
return get_process_by_language(language)


def main():
Expand Down
8 changes: 8 additions & 0 deletions pygeoweaver/sc_find.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from pygeoweaver.constants import *
import pandas as pd

from pygeoweaver.utils import check_ipython


def get_process_by_name(process_name):
"""
Expand All @@ -24,6 +26,8 @@ def get_process_by_name(process_name):
pd.set_option("display.max_rows", None) # Display all rows
pd.set_option("display.expand_frame_repr", False) # Prevent truncation of columns
pd.DataFrame(matching_processes)
if not check_ipython():
return pd.DataFrame(matching_processes)


def get_process_by_id(process_id):
Expand All @@ -47,6 +51,8 @@ def get_process_by_id(process_id):
pd.set_option("display.max_rows", None) # Display all rows
pd.set_option("display.expand_frame_repr", False) # Prevent truncation of columns
pd.DataFrame(matching_processes)
if not check_ipython():
return pd.DataFrame(matching_processes)


def get_process_by_language(language):
Expand All @@ -70,3 +76,5 @@ def get_process_by_language(language):
pd.set_option("display.max_rows", None) # Display all rows
pd.set_option("display.expand_frame_repr", False) # Prevent truncation of columns
pd.DataFrame(matching_processes)
if not check_ipython():
return pd.DataFrame(matching_processes)

0 comments on commit 22e8110

Please sign in to comment.