Skip to content
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

Moved ~/.seammrc to ~/.seamm.d/seammrc #10

Merged
merged 2 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
=======
History
=======
2024.4.22 -- Moving user preferences to ~/.seamm.d
* Added better output when there are failures in the Dashboard.
* To better support Docker, moving ~/.seammrc to ~/.seamm.d/seamrc

2023.11.15 -- Bugfix: boolean options now work
* Boolean options were not handled correctly when submitting jobs.

Expand Down
35 changes: 31 additions & 4 deletions seamm_dashboard_client/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

logger = logging.getLogger(__name__)

logger.setLevel("DEBUG")


def safe_filename(filename):
if filename[0] == "~":
Expand Down Expand Up @@ -341,7 +343,7 @@ def login(self):
(
f"Could not log in to dashboard {self.name} as "
f"{self.username} / {self.password} ({result}). "
"Check ~/.seammrc for this information."
"Check ~/.seamm.d/seammrc for this information."
),
) # lgtm [py/clear-text-logging-sensitive-data]
elif response.status_code != 200:
Expand Down Expand Up @@ -523,16 +525,41 @@ def submit(
if len(files) == 0:
logger.info("There are no files to transfer.")
else:
logger.info("Transferring files:")
job = self.job(job_id)

# Now transfer the files
for filename, newname in files.items():
logger.info(f" {filename} --> {newname}")
result = job.put_file(filename, newname)
if result is None:
logger.warning(
f"There was an error transferring the file {filename} to "
f"{self.dashboard.name}."
f"There was a major error transferring the file {filename} to "
f"{self.name}."
)
elif result.status_code == 400:
logger.warning(
"A bad input parameters was sent to dashboard "
f"{self.name} transferring the file {filename} to it."
)
elif result.status_code == 403:
logger.warning(
"The user was not properly authorized on dashboard "
f"{self.name} transferring the file {filename} to it."
)
elif result.status_code == 500:
logger.warning(
"There was an internal error in dashboard "
f"{self.name} transferring the file {filename} to it."
)
elif result.status_code == 201:
pass
else:
logger.warning(
f"The dashboard {self.name} returned error code "
"{results.status_code} transferring the file {filename} to it."
)
logger.debug(str(result))

logger.info("Submitted job #{}".format(job_id))
return job_id
Expand Down Expand Up @@ -738,7 +765,7 @@ def jobs(self):
if response.status_code != 200:
logger.warning(
"Encountered an error getting the list of jobs for project "
f"{self.name} from dashboard {self.dashboard.name}, error code: "
f"{self.name} from dashboard {self.name}, error code: "
f"{response.status_code}"
)
return {}
Expand Down
4 changes: 2 additions & 2 deletions versioneer.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,9 @@ def get_config_from_root(root):
# configparser.NoOptionError (if it lacks "VCS="). See the docstring at
# the top of versioneer.py for instructions on writing your setup.cfg .
setup_cfg = os.path.join(root, "setup.cfg")
parser = configparser.SafeConfigParser()
parser = configparser.ConfigParser()
with open(setup_cfg, "r") as f:
parser.readfp(f)
parser.read_file(f)
VCS = parser.get("versioneer", "VCS") # mandatory

def get(parser, name):
Expand Down
Loading