Skip to content

Commit 006e903

Browse files
committed
fix blockExplorer
1 parent fb1c0f4 commit 006e903

File tree

3 files changed

+30
-11
lines changed

3 files changed

+30
-11
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
__license__ = "MIT"
44
__author__ = "Mohammadreza (MMDRZA)"
55
__email__ = "[email protected]"
6-
__description__ = "Bitcoin Explorer For Monitoring Any Block and Transaction , Address With pyExplorer"
6+
__description__ = "Bitcoin Explorer For Monitoring Any Block and Transaction , Address With block Explorer"
Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
@click.group()
88
def cli():
9-
"""pyExplorer CLI tool"""
9+
"""blockExplorer CLI tool"""
1010
pass
1111

1212
@cli.command()
@@ -19,7 +19,7 @@ def install(mode: str):
1919
subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", "requirements.txt"])
2020
click.echo(click.style("✓ Local installation completed successfully!", fg="green"))
2121
click.echo("\nTo run the application, use:")
22-
click.echo(click.style(" pyexplorer run local", fg="blue"))
22+
click.echo(click.style(" blockExplorer run local", fg="blue"))
2323
except Exception as e:
2424
click.echo(click.style(f"Error during installation: {str(e)}", fg="red"))
2525
sys.exit(1)
@@ -37,7 +37,7 @@ def install(mode: str):
3737

3838
click.echo(click.style("\n✓ Docker setup completed successfully!", fg="green"))
3939
click.echo("\nTo run the application using Docker, use:")
40-
click.echo(click.style(" pyexplorer run docker", fg="blue"))
40+
click.echo(click.style(" blockExplorer run docker", fg="blue"))
4141
except subprocess.CalledProcessError:
4242
click.echo(click.style("Error: Docker or Docker Compose is not installed.", fg="red"))
4343
click.echo("Please install Docker and Docker Compose first:")
@@ -51,9 +51,9 @@ def install(mode: str):
5151
@click.argument('mode', type=click.Choice(['local', 'docker']))
5252
@click.option('--port', default=5000, help='Port to run the application on')
5353
def run(mode: str, port: int):
54-
"""Run the pyExplorer in local or docker mode"""
54+
"""Run the blockExplorer in local or docker mode"""
5555
if mode == 'local':
56-
click.echo(f"Starting pyExplorer locally on port {port}...")
56+
click.echo(f"Starting blockExplorer locally on port {port}...")
5757
try:
5858
os.environ['FLASK_APP'] = 'app'
5959
subprocess.check_call([sys.executable, "-m", "flask", "run", "--host=0.0.0.0", f"--port={port}"])
@@ -62,19 +62,38 @@ def run(mode: str, port: int):
6262
sys.exit(1)
6363

6464
elif mode == 'docker':
65-
click.echo("Starting pyExplorer using Docker...")
65+
click.echo("Starting blockExplorer using Docker...")
6666
try:
6767
subprocess.check_call(["docker-compose", "up", "--build"])
6868
except subprocess.CalledProcessError:
6969
click.echo(click.style("Error: Failed to start Docker containers.", fg="red"))
70-
click.echo("Make sure you've run 'pyexplorer install docker' first.")
70+
click.echo("Make sure you've run 'blockExplorer install docker' first.")
7171
sys.exit(1)
7272
except Exception as e:
7373
click.echo(click.style(f"Error during Docker startup: {str(e)}", fg="red"))
7474
sys.exit(1)
7575

76+
@cli.command()
77+
def help():
78+
click.echo(get_help())
79+
80+
def get_help():
81+
example = """
82+
blockExplorer install local
83+
blockExplorer install docker
84+
blockExplorer run local
85+
blockExplorer run docker
86+
"""
87+
return example
88+
7689
def main():
90+
if len(sys.argv) < 2:
91+
click.echo(get_help())
92+
sys.exit(1)
7793
cli()
7894

95+
96+
97+
7998
if __name__ == '__main__':
8099
main()

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
long_description = fh.read()
55

66
setup(
7-
name="pyExplorer",
7+
name="blockExplorer",
88
version="0.1.0",
99
author="Mmdrza",
1010
author_email="[email protected]",
@@ -18,7 +18,7 @@
1818
"License :: OSI Approved :: MIT License",
1919
"Operating System :: OS Independent",
2020
],
21-
python_requires=">=3.11",
21+
python_requires=">=3.10",
2222
install_requires=[
2323
"asyncio>=3.4.3",
2424
"flask>=3.1.0",
@@ -32,7 +32,7 @@
3232
include_package_data=True,
3333
entry_points={
3434
'console_scripts': [
35-
'pyExplorer=pyExplorer.cli:main',
35+
'blockExplorer=blockExplorer.cli:main',
3636
],
3737
},
3838
)

0 commit comments

Comments
 (0)