Files
qt-migration-legatus/qt5-before/dlbo/Lts/Tools/OnlineHelp/get_help_links.py
T
torstenandCopilot 7173785915 Qt6 Migration: Complete migration with DDS/RTI support and build validation
Major Changes:
- Merged latest Qt5 devel content from dlbo (292 files changed, 7 new dirs)
- Consolidated forward-declarations and include folders
- Removed unneeded modules per Niklas' repo check list

Build System Fixes:
- Fixed CMake VERSION_GREATER syntax in ParticipantManagement/CMakeLists.txt
- Added VLC packages (libvlc-dev, vlc-plugin-base) to docker_build.sh
- Added PostgreSQL dev packages (libpq-dev, postgresql-server-dev-all) to Dockerfile
- Fixed locale warnings (ANSI_X3.4-1968 → C.UTF-8)
- Fixed ArcGIS SDK path warnings when BUILD_ARCGIS=OFF

Code Generation Fixes:
- Fixed IDL enum collisions (PortType→CorePortType/DdsutPortType, PdmEventType)
- Fixed Grantlee template svc_translation.cpp.grantlee:
  - Changed {{ idl_enum.name }}_def:: to {{ idl_enum.name }}::
  - Fixed .underlying() calls for C++11 scoped enums (enum class)
- Removed generated files from repo (moc_*, *_dtc.h, *_ftc.h)

Validation:
- BUILD_RTI=ON: SUCCESS
- BUILD_RTI=OFF: SUCCESS
- C++17 standard maintained for RTI 7.7 compatibility
- Ubuntu 26.04 Docker environment verified

Remaining Warnings (expected):
- BgViewer, KDChart, KDReports, Poppler-Qt6 not found (optional features)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-09-15 18:20:26 +00:00

142 lines
4.7 KiB
Python
Executable File

#!/usr/bin/python
import csv
import os
import getopt
import sys
import re
import datetime
class html_links_generator(object):
def __init__( self ):
self.project = None # read from commando line: guez, ahtct etc
self.languge = 'de_DE' # read from commando line: de_DE, en_GB, en_US
self.csv_file = None # file exported from Excel, filtered on project (ex. guez.csv)
self.help_links = list() # html links generated from csv file
self.out_file = None # result file is project+language+.txt
self.html_folder = '/shd/CTC/WS/share/Lts/help/' # where to look for existing help files, can be given also on commando line
self.rootPath = '../../..' # executing from Lts/Tools/OnlineHelp
self.functionName = 'setOnlineHelpFilename' # function name to search recursively in source code
self.htmlLinks = list() # current needed html links in source code (for all projects)
self.helpFile = None # where to write all current links
def initialize(self):
if self.project == None:
print >> sys.stderr, "No project given"
sys.exit(1)
def execute(self):
print >> sys.stderr, "Looking for %s" % self.functionName
self.find_current_links()
self.helpFile = 'current_links.txt'
print >> sys.stderr, "Writing current links in file %s " % self.helpFile
f = open(self.helpFile, 'wt')
f.write('DATE: %s\n-------------------------------\n' % datetime.datetime.today())
f.write('\n'.join(str(e) for e in self.htmlLinks))
print >> sys.stderr, "Reading csv file %s" % self.csv_file
self.csv_file = self.project+'.csv'
self.read_csv(self.csv_file);
self.out_file = self.project+'_'+self.language+'.txt'
print >> sys.stderr, "Writing project links in file %s " % self.out_file
f = open(self.out_file, 'wt')
f.write('PROJECT: %s \nLANGUAGE: %s \nDATE: %s\nHTML LINKS: %s\n-------------------------------\n' % (self.project, self.language, datetime.datetime.today(), self.html_folder))
f.write('\n'.join(str(e) for e in self.help_links))
def read_csv(self, filename):
reader = csv.reader(open(os.path.join(filename), 'rt'), delimiter = ';')
for a in reader:
self.html_link(a)
def find_current_links(self):
pattern = re.compile('%s\(QStringLiteral\((.*)\)\)' % self.functionName)
for folder, dirs, files in os.walk(self.rootPath):
for file in files:
if file.endswith('.cpp') or file.endswith('.h'):
fullpath = os.path.join(folder, file)
with open(fullpath, 'r') as f:
for line in f:
if self.functionName in line:
# print(line)
# print(fullpath)
for match in pattern.findall(line):
# print(match)
new_line = match.strip('"')+';'+fullpath
self.htmlLinks.append(new_line)
def toBool(self, val):
if val == '':
return 'false'
if val == 'true' or val == '1':
return 'true'
if val == 'false' or val == '0':
return 'false'
if bool(val):
return 'true'
return 'false'
def toInt(self, val):
if val == '':
return 'NULL'
return int(val, 0)
def toFloat(self, val):
val = val.replace(',', '.')
if val == '':
return 0
return float(val)
def toString(self, val):
return val.strip()
def toJson(self, val):
return self.toString(val) # for now
def html_link(self, line):
if len(line[0]) == 0:
return
html_file = self.toString(line[0]) + '.htm'
html_path = self.html_folder + '/' + self.language + '/'
if (not os.path.exists(os.path.join(html_path, html_file))):
html_file += '; ############# MISSING ################'
self.help_links.append(html_file)
def usage():
print "Usage: %s <Options>" % sys.argv[0]
print "usage: $0 -p <project> -l <language_code> -f <html_folder>"
print " -p (--project) : guez / ahtc "
print " -l (--language) : de_DE / en_GB / en_US"
print " -f (--folder) : HTML folder to compare with"
def main():
p = html_links_generator()
try:
opts, args = getopt.getopt(sys.argv[1:], "p:l:f:", ["project","language","folder"])
except getopt.GetoptError, err:
print >> sys.stderr, err
usage()
sys.exit(2)
for o, a in opts:
if o in ("-p", "--project"):
p.project = a
print >> sys.stderr, "PROJECT: %s" % a
if o in ("-l", "--language"):
p.language = a
print >> sys.stderr, "LANGUAGE: %s" % a
if o in ("-f", "--folder"):
p.html_folder = a
print >> sys.stderr, "FOLDER: %s" % a
p.initialize()
p.execute()
sys.exit(0)
if __name__ == "__main__":
main()