Skip to content

Commit

Permalink
Windows adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
treee111 committed Apr 1, 2023
1 parent d6032ba commit 3323629
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
9 changes: 5 additions & 4 deletions docs/QUICKSTART_ANACONDA.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,12 @@ For integrating contour lines into the generated maps, some additional steps nee
An additional Python packages has to be installed and you need an free account for USGS to query contour lines from.

### Install phyghtmap
1. Download and unpack http://katze.tfiu.de/projects/phyghtmap/phyghtmap_2.23.orig.tar.gz
2. Enter your Anaconda environment and go to the unpacked folder
3. Install phyghtmap into your Anaconda environment with
1. Download http://katze.tfiu.de/projects/phyghtmap/phyghtmap_2.23.orig.tar.gz
2. Unpack the file with 7zip on Windows or with native file archiver on macOS / Linux
3. Enter your Anaconda environment and go to the unpacked content
4. Install phyghtmap into your Anaconda environment with
```
sudo python3 setup.py install
sudo python setup.py install
```

### Free account for USGS
Expand Down
5 changes: 4 additions & 1 deletion wahoomc/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
from wahoomc.setup_functions import initialize_work_directories, \
check_installation_of_required_programs, write_config_file, \
adjustments_due_to_breaking_changes, copy_jsons_from_repo_to_user, \
check_installed_version_against_latest_pypi, check_installation_of_additional_programs
check_installed_version_against_latest_pypi, check_installation_of_additional_programs, \
check_or_ask_for_earthexplorer_credentials
from wahoomc.downloader import download_tooling

from wahoomc.osm_maps_functions import OsmMaps
Expand Down Expand Up @@ -57,6 +58,8 @@ def run(run_level):

if o_input_data.contour:
check_installation_of_additional_programs()
# check or ask for earthexplorer credentials
check_or_ask_for_earthexplorer_credentials()

o_osm_data = OsmData()
# Check for not existing or expired files. Mark for download, if dl is needed
Expand Down
16 changes: 14 additions & 2 deletions wahoomc/setup_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def move_old_content_into_new_dirs():
copy files from download- and output- directory of earlier version to the new folders
delete directory from earlier versions afterwards
having folder on the same level as the wahooMapsCreator was introduces in release v1.1.0 with PR #93.
#93.
having folder on the same level as the wahooMapsCreator was introduces in release v1.1.0 with PR
This coding is only valid/needed when using the cloned version or .zip version.
If working with a installed version via PyPI, nothing will be done because folders to copy do not exist
"""
Expand Down Expand Up @@ -172,6 +173,15 @@ def is_map_writer_plugin_installed():
return False


def check_or_ask_for_earthexplorer_credentials():
username, password = read_earthexplorer_credentials()

if not username or not password:
username, password = ask_for_and_write_earthexplorer_credentials()

return username, password


def write_config_file(config_to_write=''):
"""
Write config file of wahoomc to root directory
Expand Down Expand Up @@ -215,7 +225,9 @@ def ask_for_and_write_earthexplorer_credentials():
Ask user for credentials for https://ers.cr.usgs.gov and save in the config file
"""
log.warning(
'No saved credentials found for https://ers.cr.usgs.gov. Please register and enter your credentials.')
'You want to integrate contour lines. Needed credentials for USGS are not saved on this computer.')
log.warning(
'Please register on https://ers.cr.usgs.gov and enter your credentials in the following fields.')
username = input('https://ers.cr.usgs.gov username:')
password = input('https://ers.cr.usgs.gov password:')

Expand Down

0 comments on commit 3323629

Please sign in to comment.