Hi everyone,
I am new to Beyond Compare so bare with me. I am currently brainstorming a Python code that will read in all the source files from a directory (including source files from subfolders) in a network, take the physical SLOC (Source Line of Code) count for each file, then sum them up and output it on a xml file.
From what I have read on the "Automating with Scripts" page, it does not seem BC3 has a library set that I can use on other languages like Python. So what I will probably have to do is write a BC script to take in all the source files from a directory, then get and output the SLOC count. Then write a Python code to run the script, then parse the SLOC counts from the output file, add all the SLOC counts up (unless I can get the total SLOC count directly), and generate an xml file with that info. Do you think that is the most logical way of doing things?
I am not entirely sure what BC scripts are capable of, like what functions to use to get all the files from a directory. Also, I don't need to compare any files. I just need the SLOC counts. I guess I could name the same directory twice, but it seems redundant.
Any help is appreciated.
Thanks.
Elton
I am new to Beyond Compare so bare with me. I am currently brainstorming a Python code that will read in all the source files from a directory (including source files from subfolders) in a network, take the physical SLOC (Source Line of Code) count for each file, then sum them up and output it on a xml file.
From what I have read on the "Automating with Scripts" page, it does not seem BC3 has a library set that I can use on other languages like Python. So what I will probably have to do is write a BC script to take in all the source files from a directory, then get and output the SLOC count. Then write a Python code to run the script, then parse the SLOC counts from the output file, add all the SLOC counts up (unless I can get the total SLOC count directly), and generate an xml file with that info. Do you think that is the most logical way of doing things?
I am not entirely sure what BC scripts are capable of, like what functions to use to get all the files from a directory. Also, I don't need to compare any files. I just need the SLOC counts. I guess I could name the same directory twice, but it seems redundant.
Any help is appreciated.
Thanks.
Elton
Comment