11#!/usr/bin/env python3
22# -*- mode: python; py-indent-offset: 4; py-continuation-offset: 4 -*-
3- """
4- Example app for SetProgramOptions
5- """
3+
64import os
75from pprint import pprint
86
9-
107import setprogramoptions
118
129
1310
14- def find_config_ini (filename = "config.ini" , rootpath = "." ):
11+ def find_config_ini (filename = "config.ini" , rootpath = "." ):
1512 """
1613 Recursively searches for a particular file among the subdirectory structure.
1714 If we find it, then we return the full relative path to `pwd` to that file.
@@ -28,12 +25,12 @@ def find_config_ini(filename="config.ini", rootpath="." ):
2825
2926 """
3027 output = None
31- for dirpath ,dirnames ,filename_list in os .walk (rootpath ):
28+ for dirpath , dirnames , filename_list in os .walk (rootpath ):
3229 if filename in filename_list :
3330 output = os .path .join (dirpath , filename )
3431 break
3532 if output is None :
36- raise FileNotFoundError ("Unable to find {} in {}" .format (filename , os .getcwd ())) # pragma: no cover
33+ raise FileNotFoundError ("Unable to find {} in {}" .format (filename , os .getcwd ())) # pragma: no cover
3734 return output
3835
3936
@@ -60,7 +57,7 @@ def test_setprogramoptions(filename="config.ini"):
6057 print ("Bash Output" )
6158 print ("-----------" )
6259 option_list = parser .gen_option_list (section_name , generator = "bash" )
63- print ( " \\ \n " .join (option_list ) )
60+ print (" \\ \n " .join (option_list ))
6461
6562 print ("" )
6663 print ("CMake Fragment" )
@@ -85,13 +82,15 @@ def parse_section(parser, section):
8582 pprint (data , width = 120 )
8683
8784 # Print the loginfo from the last search (change if to True to enable)
88- if (False ):
85+ if (False ):
8986 print ("\n LogInfo" )
9087 print ("-------" )
9188 #parser._loginfo_print(pretty=True)
9289
9390 # Filter out just the entry and exits for handlers
94- handler_list = [ (d ['type' ], d ['name' ]) for d in parser ._loginfo if d ['type' ] in ['handler-entry' ,'handler-exit' ]]
91+ handler_list = [
92+ (d ['type' ], d ['name' ]) for d in parser ._loginfo if d ['type' ] in ['handler-entry' , 'handler-exit' ]
93+ ]
9594 pprint (handler_list , width = 120 )
9695
9796 return data
@@ -112,4 +111,3 @@ def main():
112111if __name__ == "__main__" :
113112 main ()
114113 print ("Done." )
115-
0 commit comments