File tree Expand file tree Collapse file tree 3 files changed +53
-1
lines changed
src/diffpy/distanceprinter Expand file tree Collapse file tree 3 files changed +53
-1
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ exclude = [] # exclude packages matching these glob patterns (empty by default)
4949namespaces = false # to disable scanning PEP 420 namespaces (true by default)
5050
5151[project .scripts ]
52- diffpy-distanceprinter = " diffpy.distanceprinter:main"
52+ diffpy-distanceprinter = " diffpy.distanceprinter.distanceprinter_app :main"
5353
5454[tool .setuptools .dynamic ]
5555dependencies = {file = [" requirements/pip.txt" ]}
Original file line number Diff line number Diff line change 1+ import argparse
2+
3+ from diffpy .distanceprinter .version import __version__ # noqa
4+
5+
6+ def main ():
7+ parser = argparse .ArgumentParser (
8+ prog = "diffpy.distanceprinter" ,
9+ description = (
10+ "Distance Printer, calculate the inter atomic distances. Part of xPDFsuite.\n \n "
11+ "For more information, visit: "
12+ "https://github.com/diffpy/diffpy.distanceprinter/"
13+ ),
14+ formatter_class = argparse .RawDescriptionHelpFormatter ,
15+ )
16+
17+ parser .add_argument (
18+ "--version" ,
19+ action = "store_true" ,
20+ help = "Show the program's version number and exit" ,
21+ )
22+
23+ args = parser .parse_args ()
24+
25+ if args .version :
26+ print (f"diffpy.distanceprinter { __version__ } " )
27+ else :
28+ # Default behavior when no arguments are given
29+ parser .print_help ()
30+
31+
32+ if __name__ == "__main__" :
33+ main ()
Original file line number Diff line number Diff line change 1+ import json
2+ from pathlib import Path
3+
4+ import pytest
5+
6+
7+ @pytest .fixture
8+ def user_filesystem (tmp_path ):
9+ base_dir = Path (tmp_path )
10+ home_dir = base_dir / "home_dir"
11+ home_dir .mkdir (parents = True , exist_ok = True )
12+ cwd_dir = base_dir / "cwd_dir"
13+ cwd_dir .mkdir (parents = True , exist_ok = True )
14+
15+ home_config_data = {"username" : "home_username" , "email" : "home@email.com" }
16+ with open (home_dir / "diffpyconfig.json" , "w" ) as f :
17+ json .dump (home_config_data , f )
18+
19+ yield tmp_path
You can’t perform that action at this time.
0 commit comments