Skip to content

Commit

Permalink
Merge pull request #1392 from StochSS/develop
Browse files Browse the repository at this point in the history
Release v2.4.14
  • Loading branch information
briandrawert authored Sep 27, 2022
2 parents 4b866ff + 6419b15 commit 3828892
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion __version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# @website https://github.com/stochss/stochss
# =============================================================================

__version__ = '2.4.13'
__version__ = '2.4.14'
__title__ = 'StochSS'
__description__ = 'StochSS is an integrated development environment (IDE) \
for simulation of biochemical networks.'
Expand Down
12 changes: 8 additions & 4 deletions stochss/handlers/util/stochss_folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,14 @@ def __get_file_from_link(self, remote_path):
raise StochSSFileNotFoundError(message, traceback.format_exc())
return ext, file, body

def __get_rmt_upld_path(self, file):
def __get_rmt_upld_path(self, file, dirname=None):
if not file.endswith(".zip"):
return file
files = os.listdir(self.user_dir)
if dirname is None:
dirname = self.user_dir
files = os.listdir(dirname)
files.remove(file)
paths = list(map(lambda file: os.path.join(self.user_dir, file), files))
paths = list(map(lambda file: os.path.join(self.user_dir, dirname, file), files))
return max(paths, key=os.path.getctime)


Expand Down Expand Up @@ -598,7 +600,9 @@ def upload_from_link(self, remote_path, overwrite=False):
file_types = {"mdl":"model", "smdl":"model", "sbml":"sbml"}
file_type = file_types[ext] if ext in file_types else "file"
_ = self.upload(file_type=file_type, file=file, body=body)
if "github.com/StochSS/StochSS_Example_Library/raw/" not in remote_path:
if "github.com/StochSS/StochSS_Example_Library/raw/" in remote_path:
new_path = self.__get_rmt_upld_path(file=file, dirname="Examples")
else:
new_path = self.__get_rmt_upld_path(file=file)
message = f"Successfully uploaded the file {file} to {new_path}"
return {"message":message, "file_path":new_path}
Expand Down

0 comments on commit 3828892

Please sign in to comment.