Skip to content

Commit

Permalink
change name of remove() func and remove pickle upon --remove
Browse files Browse the repository at this point in the history
  • Loading branch information
shadeyg56 committed Jan 26, 2023
1 parent d8bce46 commit 573452a
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion auto_cpufreq/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def deploy_daemon_performance():


# remove auto-cpufreq daemon
def remove():
def remove_daemon():

# check if auto-cpufreq is installed
if not os.path.exists("/usr/local/bin/auto-cpufreq-remove"):
Expand All @@ -450,6 +450,10 @@ def remove():
# remove auto-cpufreq-remove
os.remove("/usr/local/bin/auto-cpufreq-remove")

# delete override pickle if it exists
if os.path.exists(STORE):
os.remove(STORE)

# delete stats file
if auto_cpufreq_stats_path.exists():
if auto_cpufreq_stats_file is not None:
Expand Down Expand Up @@ -1216,6 +1220,13 @@ def daemon_running_msg():
)
footer()

def daemon_not_running_msg():
print("\n" + "-" * 24 + " auto-cpufreq not running " + "-" * 30 + "\n")
print(
"ERROR: auto-cpufreq is not running in daemon mode.\n\nMake sure to start the daemon with --install before running with --force option"
)
footer()


# check if auto-cpufreq --daemon is running
def running_daemon():
Expand All @@ -1225,3 +1236,12 @@ def running_daemon():
elif os.getenv("PKG_MARKER") == "SNAP" and dcheck == "enabled":
daemon_running_msg()
exit(1)

# check if auto-cpufreq --daemon is not running
def not_running_daemon():
if not is_running("auto-cpufreq", "--daemon"):
daemon_not_running_msg()
exit(1)
elif os.getenv("PKG_MARKER") == "SNAP" and dcheck == "disabled":
daemon_not_running_msg()
exit(1)

0 comments on commit 573452a

Please sign in to comment.