importfileinputimportsysimportosimportglobdefget_actual_filename(name):dirs=name.split('\\')# disk lettertest_name=[dirs[0].upper()]fordindirs[1:]:test_name+=["%s[%s]"%(d[:-1],d[-1])]res=glob.glob('\\'.join(test_name))ifnotres:#File not foundreturnNonereturnres[0]filelist=[get_actual_filename(x.rstrip())forxinfileinput.input(['-'])]prefix_len=len(os.path.commonprefix(filelist))print("""SRCSRV: ini ------------------------------------------------VERSION=2SRCSRV: variables ------------------------------------------SRCSRVVERCTRL=httpsSRCSRVTRG=https://raw.github.com/mavlink/qgroundcontrol/%s/%%var2%%SRCSRV: source files ---------------------------------------"""%os.environ['APPVEYOR_REPO_COMMIT'])forlineinfilelist:iflineisnotNone:print('%s*%s'%(line,line[prefix_len:].replace('\\','/')))print("SRCSRV: end ------------------------------------------------")