-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from ZihengSun/main
sync
- Loading branch information
Showing
2 changed files
with
41 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,54 @@ | ||
import getpass | ||
from logging import getLogger | ||
import subprocess | ||
from pygeoweaver.utils import ( | ||
check_ipython, | ||
download_geoweaver_jar, | ||
get_geoweaver_jar_path, | ||
get_java_bin_path, | ||
get_root_dir, | ||
) | ||
|
||
logger = getLogger(__name__) | ||
|
||
def get_password_twice(): | ||
while True: | ||
password1 = getpass.getpass('Enter password: ') | ||
password2 = getpass.getpass('Re-enter password: ') | ||
|
||
if password1 == password2: | ||
return password1 | ||
else: | ||
print("Passwords don't match. Please try again.") | ||
|
||
|
||
def reset_password(): | ||
""" | ||
Usage: <main class> resetpassword | ||
Reset password for localhost | ||
""" | ||
download_geoweaver_jar() | ||
subprocess.run( | ||
[ | ||
get_java_bin_path(), | ||
"-jar", | ||
get_geoweaver_jar_path(), | ||
"resetpassword", | ||
] | ||
) | ||
|
||
if check_ipython(): | ||
logger.debug("ipython is here") | ||
password = get_password_twice() | ||
subprocess.run( | ||
[ | ||
get_java_bin_path(), | ||
"-jar", | ||
get_geoweaver_jar_path(), | ||
"resetpassword", | ||
"-p", | ||
password | ||
] | ||
) | ||
else: | ||
logger.debug("not ipython") | ||
subprocess.run( | ||
[ | ||
get_java_bin_path(), | ||
"-jar", | ||
get_geoweaver_jar_path(), | ||
"resetpassword", | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" | |
|
||
[project] | ||
name = "pygeoweaver" | ||
version = "0.6.17" | ||
version = "0.6.19" | ||
authors = [ | ||
{ name="Geoweaver team", email="[email protected]" }, | ||
] | ||
|
@@ -22,7 +22,7 @@ classifiers = [ | |
|
||
[tool.poetry] | ||
name = "pygeoweaver" | ||
version = "0.6.17" | ||
version = "0.6.19" | ||
description = "This is a wrapper package of the Geoweaver app." | ||
authors = ["Geoweaver team <[email protected]>"] | ||
readme = "README.md" | ||
|