****************************************** buildMain_WioT_v01o01_2023EMay15 (.txt) ****************************************** #buildMain_WioT_v01o01_2023EMay15_i.py def buildMain_WioT_v01o01_2023EMay15_i(): #By: D@CC #Date: 2023EMay15 #Purpose: To build (and copy) each main.py WioT program #Parms In: # parm1 str progName #Parms Out: # parm1 bool isSuccess True # #Issues: 1. the only name allowed by WioT is main.py # so use improvised programs ending in "_i.py" # 2. to save space on the WioT # this program will run in the RPi # this program will remove all comments # the function definitions will reside on the RPi # 3. When the uSD card works on the WioT, buildMain will run on the WioT # 4. Searches current folder and Desktop/ix/ for functions # #Version 01o01 tested OK # includes all functions requested by the statement: # request("strFunc(. . . )") # which is a function call [instead of "include"] #Eg # s="";T=True;i=0;v="0" # request("show(s,s,T,v="")" ) #syntax of v="" ????? # # (Initially the functions won't process the "v" correctly ) # Until they do . . . # Note 1 the definition of the function "show" will prepend the module built # Note 2 buildMain can include improvised functions programs (in future) # Note 3 a future version of buildMain will write out "request(show(s,s,T,v))" # by not copying the two '"' (before and after "show"). # Note 4 that v is the minimum version needed by this program eg "00" (future) # Note 5 each function will verify the version # if v is passed to it (future) # Note 6 each function will immediately return if v is passed to it (future) # Note 7 The author created a program that can list the functions it calls. #Abstract of buildMain program # Name of program to build is passed to buildMain # open the program to build # Open (for writing) the program to be built # for each record: # if a comment: ignore # else: # if it says "request(": # grep the name of the function # if not found: # strMsg = "not included" # insert strMsg in the request line # else # open the function file # for all records: # read record # if a comment: ignore # else: write out the record # write out the request line # else: # write out the record # close both # copy main.py to WioT # done #Calls # from pathlib import Path import datetime #/buildMain_WioT_v01o01_2023EMay15.py #def end #************************************************************************************ #/buildMain_WioT_v01o01_2023EMay15.py