Skip to content

Commit

Permalink
Merge pull request #318 from Farseer-NMR/pr_v1.3.6
Browse files Browse the repository at this point in the history
Download instructions when HTTP Error 403 Forbidden v1.3.6
  • Loading branch information
joaomcteixeira authored Apr 17, 2020
2 parents 6dbec6a + 0d363d9 commit e28a3af
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 25 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

We are currently rewriting Farseer-NMR towards **version 2**. And you are now visiting **version 1** branch.

**Version 1** is still functional and working, though not much supported apart from minor bugs. You can download the latest stable version, v1.3.5, on the [releases tab](https://github.com/Farseer-NMR/FarSeer-NMR/releases/tag/v1.3.5), or visit the complete version 1 code and its documentation in [version 1 branch](https://github.com/Farseer-NMR/FarSeer-NMR/tree/version1) on GitHub.
**Version 1** is still functional and working, though not much supported apart from minor bugs. You can download the latest stable version, v1.3.6, on the [releases tab](https://github.com/Farseer-NMR/FarSeer-NMR/releases/tag/v1.3.6), or visit the complete version 1 code and its documentation in [version 1 branch](https://github.com/Farseer-NMR/FarSeer-NMR/tree/version1) on GitHub.

Our original publication is available at [JBioMolNMR](https://link.springer.com/article/10.1007/s10858-018-0182-5), cite us if you use Farseer-NMR for your research, regardless of which version you use.

Expand All @@ -30,15 +30,17 @@ With Farseer-NMR, you have:

# Download, Install and Update

[Download here the latest version of Farseer-NMR.](https://github.com/Farseer-NMR/FarSeer-NMR/releases)
[Download here the latest stable version of Farseer-NMR.](https://github.com/Farseer-NMR/FarSeer-NMR/releases), **please note that the version at the `master` branch is not stable.**

Unpack the download compressed file and navigate to the newly created `FarSeer-NMR` folder.

To install Farseer-NMR simply run the installation script:

```
python install_farseernmr.py
```

Read [here](https://github.com/Farseer-NMR/FarSeer-NMR/wiki/Download,-Install-and-Update) some additional detail on how to setup your Farseer-NMR installation - it's very easy!
Read [here](https://github.com/Farseer-NMR/FarSeer-NMR/wiki/Download,-Install-and-Update) some additional details on how to setup your Farseer-NMR installation - it's very easy!

# Documentation

Expand Down
25 changes: 20 additions & 5 deletions install/commons.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
Contributors to this file:
- Joao M.C. Teixeira (https://github.com/joaomcteixeira)
Farseer-NMR is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
Expand Down Expand Up @@ -61,12 +60,15 @@

if python_version < 3:
import urllib as url
from urllib2 import HTTPError
url_request_error = urllib2.HTTPError
url_not_found_error = IOError
user_input = raw_input

elif python_version == 3:
import urllib
import urllib.request as url
url_request_error = urllib.error.HTTPError
url_not_found_error = urllib.error.URLError
user_input = input

Expand Down Expand Up @@ -158,26 +160,39 @@ def reporthook(blocknum, blocksize, totalsize):
def download_file(link, destination):
"""
Downloads file.
Parameters:
- link (str): the file URL
- destination (str): where to save file in computer
"""
log.info("* Downloading {}...".format(link))
log.info("* ... to destination: {}".format(destination))

try:
url.urlretrieve(
link,
destination,
reporthook
)
except url_request_error as err:
if os.path.exists(destination):
pass
else:
errmsg = (
'* ATTENTION * Anaconda servers have blocked the download of Miniconda.\n'
'* ATTENTION * Please download manually the Miniconda installation file\n'
'* ATTENTION * provided in the link bellow:\n'
f'* ATTENTION * {link}\n'
'* ATTENTION * place the Miniconda installation file int he FarSeer-NMR folder\n'
'* ATTENTION * and repeat the installation process again.'
)
log.info(errmsg)
sys.exit()
except url_not_found_error as e:
log.info(messages.url_error)
log.info(messages.something_wrong)
log.debug(e)
log.info(messages.abort)
sys_exit()
sys.exit()
except ValueError as e:
log.info(messages.url_unkown)
log.debug(e)
Expand All @@ -189,7 +204,7 @@ def download_file(link, destination):
log.info(messages.something_wrong)
log.info(messages.abort)
sys_exit()

if os.path.exists(destination):
log.debug("destination file found: {}".format(destination))
log.info("... Download completed")
Expand Down
28 changes: 12 additions & 16 deletions install/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,37 +324,33 @@ def _formats_short_title(s):
# http://patorjk.com/software/taag/#p=display&h=1&f=Doom&t=---------%0AFarseer-NMR%0Av1.3.3%0A---------
banner = r"""
______ ______ ______ ______ ______ ______ ______ ______ ______
|______||______||______||______||______||______||______||______||______|
______ _____ _ _ ___ _________
| ___| / ___| | \ | || \/ || ___ \
| |_ __ _ _ __\ `--. ___ ___ _ __ ______ | \| || . . || |_/ /
| _|/ _` || '__|`--. \ / _ \ / _ \| '__||______|| . ` || |\/| || /
| | | (_| || | /\__/ /| __/| __/| | | |\ || | | || |\ \
\_| \__,_||_| \____/ \___| \___||_| \_| \_/\_| |_/\_| \_|
______ _ _ ___ _________
| ___| | \ | || \/ || ___ \
| |_ __ _ _ __ ___ ___ ___ _ __ ______ | \| || . . || |_/ /
| _|/ _` || '__|/ __| / _ \ / _ \| '__||______|| . ` || |\/| || /
| | | (_| || | \__ \| __/| __/| | | |\ || | | || |\ \
\_| \__,_||_| |___/ \___| \___||_| \_| \_/\_| |_/\_| \_|
__ _____ _____
/ | |____ | | ___|
__ __`| | / / |___ \
\ \ / / | | \ \ \ \
\ V / _| |_ _ .___/ /_ /\__/ /
\_/ \___/(_)\____/(_)\____/
__ _____ ____
/ | |____ | / ___|
__ __`| | / / / /___
\ \ / / | | \ \ | ___ \
\ V / _| |_ _ .___/ /_ | \_/ |
\_/ \___/(_)\____/(_)\_____/
______ ______ ______ ______ ______ ______ ______ ______ ______
|______||______||______||______||______||______||______||______||______|
"""

if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion install/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

# configure accordingly to the host project
software_name = "Farseer-NMR"
software_version = (1, 3, 5) # v1.0.0
software_version = (1, 3, 6) # v1.0.0
min_space_allowed = 3 # min GB required to install your software
installation_log_name = "install.log"
update_log_name = "update.log"
Expand Down

0 comments on commit e28a3af

Please sign in to comment.