This branch commit refactors the pvcnoded component to better adhere to good programming practices. The previous Daemon.py was a massive file which contained almost 2000 lines of direct, root-level code which was directly imported. Not only was this poor practice, but this resulted in a nigh-unmaintainable file which was hard even for me to understand. This refactoring splits a large section of the code from Daemon.py into separate small modules and functions in the `util/` directory. This will hopefully make most of the functionality easy to find and modify without having to dig through a single large file. Further the existing subcomponents have been moved to the `objects/` directory which clearly separates them. Finally, the Daemon.py code has mostly been moved into a function, `entrypoint()`, which is then called from the `pvcnoded.py` stub. An additional item is that most format strings have been replaced by f-strings to make use of the Python 3.6 features in Daemon.py and the utility files.
		
			
				
	
	
		
			16 lines
		
	
	
		
			323 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			323 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #!/usr/bin/env bash
 | |
| 
 | |
| if ! which flake8 &>/dev/null; then
 | |
|     echo "Flake8 is required to lint this project"
 | |
|     exit 1
 | |
| fi
 | |
| 
 | |
| flake8 \
 | |
|     --ignore=E501,E241 \
 | |
|     --exclude=debian,api-daemon/migrations/versions,api-daemon/provisioner/examples
 | |
| ret=$?
 | |
| if [[ $ret -eq 0 ]]; then
 | |
|     echo "No linting issues found!"
 | |
| fi
 | |
| exit $ret
 |