mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-10-31 10:48:02 +00:00 
			
		
		
		
	Updates to import statements:
- Import importlib, os, and sys to each python script.
 - Append "lanforge-scripts" root directory to the system path, allowing each script to be called from an antecedent directory. e.g.
if 'lanforge-scripts' not in sys.path:
    sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../../../")))
 - All statements of the form 'from <module> import <class>' replace with:
<module> = importlib.import_module("lanforge-scripts.<directory>.<module>")
<class> = <module>.<class>
			
			
This commit is contained in:
		| @@ -17,16 +17,28 @@ COPYWRITE | ||||
|  | ||||
| INCLUDE_IN_README | ||||
| ''' | ||||
|  | ||||
| import sys | ||||
| import os | ||||
| import importlib | ||||
| import matplotlib.pyplot as plt | ||||
| import matplotlib as mpl | ||||
| import numpy as np | ||||
| import pandas as pd | ||||
| import pdfkit | ||||
| from lf_report import lf_report | ||||
| from lf_graph import lf_bar_graph, lf_scatter_graph, lf_stacked_graph, lf_horizontal_stacked_graph | ||||
| import random | ||||
|  | ||||
| if 'lanforge-scripts' not in sys.path: | ||||
|     sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../../"))) | ||||
|  | ||||
| lf_report = importlib.import_module("lanforge-scripts.py-scripts.lf_report") | ||||
| lf_report = lf_report.lf_report | ||||
| lf_graph = importlib.import_module("lanforge-scripts.py-scripts.lf_graph") | ||||
| lf_bar_graph = lf_graph.lf_bar_graph | ||||
| lf_scatter_graph = lf_graph.lf_scatter_graph | ||||
| lf_stacked_graph = lf_graph.lf_stacked_graph | ||||
| lf_horizontal_stacked_graph = lf_graph.lf_horizontal_stacked_graph | ||||
|  | ||||
|  | ||||
| # Unit Test | ||||
| if __name__ == "__main__": | ||||
|     # Testing: generate data frame | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 erinnerim
					erinnerim