Skip to content

Commit

Permalink
restructure modules
Browse files Browse the repository at this point in the history
  • Loading branch information
taquangtrung committed Apr 18, 2023
1 parent 23e19b9 commit c791b2e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
8 changes: 4 additions & 4 deletions solc_detect/__init__.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#!/usr/bin/env python3

from . import lib
from solc_detect import solc_detect


def find_pragma_solc_version(input_file):
"""Find the Solidity version declared in pragma of a smart contract."""
return lib.find_pragma_solc_version(input_file)
return solc_detect.find_pragma_solc_version(input_file)


def find_best_solc_version(input_file):
"""Find the best version of Solc compiler for a smart contract."""
return lib.find_best_solc_version(input_file)
return solc_detect.find_best_solc_version(input_file)


def find_best_solc_version_for_pragma(pragma_version):
"""Find the best version of Solc compiler for pragma."""
return lib.find_best_solc_version_for_pragma(pragma_version)
return solc_detect.find_best_solc_version_for_pragma(pragma_version)
8 changes: 3 additions & 5 deletions solc_detect/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@

import toml

import solc_detect

from . import lib
from solc_detect import solc_detect


def configure_cli_arguments():
Expand Down Expand Up @@ -75,11 +73,11 @@ def main():
arg_parser.print_usage()
arg_parser.exit()

pragma_version = lib.find_pragma_solc_version(input_file)
pragma_version = solc_detect.find_pragma_solc_version(input_file)
if args.verbose:
print("Detected pragmas:", pragma_version)

best_version = lib.find_best_solc_version_for_pragma(pragma_version)
best_version = solc_detect.find_best_solc_version_for_pragma(pragma_version)
if args.verbose:
print("Best version:", best_version)
else:
Expand Down
2 changes: 1 addition & 1 deletion solc_detect/lib.py → solc_detect/solc_detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import nodesemver
import semantic_version

from . import pragma_parser
from solc_detect import pragma_parser

# from semantic_version import NpmSpec, Version

Expand Down

0 comments on commit c791b2e

Please sign in to comment.