From 8ef82763a50fb5130e3d3c2c919832cd18f591a2 Mon Sep 17 00:00:00 2001 From: Rongxin Liu Date: Wed, 26 Jun 2024 01:05:24 -0400 Subject: [PATCH] auto-accept honesty question when in R studio --- setup.py | 2 +- submit50/__main__.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 5e028c3..5e6fce8 100755 --- a/setup.py +++ b/setup.py @@ -26,6 +26,6 @@ entry_points={ "console_scripts": ["submit50=submit50.__main__:main"] }, - version="3.1.4", + version="3.1.5", include_package_data=True ) diff --git a/submit50/__main__.py b/submit50/__main__.py index b255506..d1538ce 100755 --- a/submit50/__main__.py +++ b/submit50/__main__.py @@ -3,6 +3,7 @@ import enum import gettext import logging +import os import re import shutil import sys @@ -144,7 +145,11 @@ def prompt(honesty, included, excluded): honesty_question = str(honesty) # Get the user's answer - answer = input(honesty_question) + # If in R Studio environment, answer is always yes + if os.getenv("RSTUDIO") == "1": + answer = "yes" + else: + answer = input(honesty_question) except EOFError: answer = None print()