#!/usr/bin/env python3 # This file is part of the LibreOffice project. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. """ Script to generate https://wiki.documentfoundation.org/Development/DispatchCommands """ import argparse import os import sys def get_files_list(directory, extension): array_items = [] dh = os.scandir(directory) for entry in dh: if entry.is_dir(): array_items += get_files_list(entry.path, extension) elif entry.is_file(): if entry.name.endswith(extension): array_items.append(entry.path) return array_items def analyze_file(filename, all_slots): with open(filename) as fh: for line in fh: if not line.startswith('// Slot Nr. '): continue tmp = line.split(':') slot_id = tmp[1].strip() line = next(fh) tmp = line.split(',') slot_rid = tmp[1] next(fh) next(fh) line = next(fh) mode = 'C' if 'CACHABLE' in line else ' ' mode += 'U' if 'AUTOUPDATE' in line else ' ' mode += 'M' if 'MENUCONFIG' in line else ' ' mode += 'T' if 'TOOLBOXCONFIG' in line else ' ' mode += 'A' if 'ACCELCONFIG' in line else ' ' next(fh) next(fh) line = next(fh) if '"' not in line: line = next(fh) tmp = line.split('"') try: slot_name = '.uno:' + tmp[1] except IndexError: print("Warning: expected \" in line '%s' from file %s" % (line.strip(), filename), file=sys.stderr) slot_name = '.uno:' if slot_name not in all_slots: all_slots[slot_name] = {'slot_id': slot_id, 'slot_rid': slot_rid, 'mode': mode, 'slot_description': ''} def analyze_xcu(filename, all_slots): with open(filename) as fh: for line in fh: if '' not in line: try: line = next(fh) except StopIteration: print("Warning: couldn't find '' line in %s" % filename, file=sys.stderr) break line = line.replace('', '') line = line.replace('', '').strip() if slot_name in all_slots: all_slots[slot_name]['slot_description'] = line.replace('~', '') def main(): modules = ['basslots', 'scslots', 'sdgslots', 'sdslots', 'sfxslots', 'smslots', 'svxslots', 'swslots'] sdi_dir = './workdir/SdiTarget' sdi_ext = '.hxx' xcu_dir = 'officecfg/registry/data/org/openoffice/Office/UI' xcu_ext = '.xcu' all_slots = {} parser = argparse.ArgumentParser() parser.add_argument('module', choices=modules) args = parser.parse_args() module_filename = args.module + sdi_ext sdi_files = get_files_list(sdi_dir, sdi_ext) for sdi_file in sdi_files: sdi_file_basename = os.path.basename(sdi_file) if sdi_file_basename == module_filename: analyze_file(sdi_file, all_slots) xcu_files = get_files_list(xcu_dir, xcu_ext) for xcu_file in xcu_files: analyze_xcu(xcu_file, all_slots) for name in sorted(all_slots.keys()): props = all_slots[name] print('|-\n| %s' % name) print('| %(slot_rid)s\n| %(slot_id)s\n| %(mode)s\n| %(slot_description)s' % props) print("|-") if __name__ == '__main__': main() ora/cp-5.3-desktop LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2017-05-17tdf#43535: support additional sheet protection options.Kohei Yoshida
2017-05-13use empty document in orcus gnumeric import, tdf#107828Markus Mohrhard
2017-05-11tdf#107258 Create show/hide all comments toggle button.Gulsah Kose
2017-05-10loplugin:checkunusedparams in sc(part2)Noel Grandin
2017-05-10loplugin:checkunusedparams in sc(part1)Noel Grandin
2017-05-03tdf#107255: detect whether the range has only one data cell.Kohei Yoshida
2017-04-26remove sc bitmaps from .src filesCaolán McNamara
2017-04-11tdf#84837 Add Show/Hide all comments commands to Calc.Gulsah Kose
2017-03-31tdf#82580 tools: rename Rectangle to tools::RectangleMiklos Vajna
2017-03-23Typo: boder->borderJulien Nabet
2017-03-15Make the header file more readable.Gulsah Kose
2017-03-11Fix typosAndrea Gelmini
2017-03-03Remove redundant 'inline' keywordStephan Bergmann
2017-03-01typesafe wrappers for css::i18nutil::TransliterationModulesNoel Grandin
2017-02-22less ugly ClosingClipboardSource()Eike Rathke
2017-02-13convert CharCompressType to scoped enumNoel Grandin
2017-02-03TyposJulien Nabet
2017-02-02CreateQueryParam to take a ScRange parameter.Kohei Yoshida
2017-01-23Change all Idle* LINKs to be Timer*Jan-Marek Glogowski
2017-01-18tdf#104967 preserve isolated notes data in clipboard when closing documentEike Rathke
2016-12-23tdf#97597: Make the document import state more multi-thread friendly.Kohei Yoshida
2016-12-22Pass SfxPrinter by VclPtrStephan Bergmann
2016-12-08convert SFX_HINT to scoped enumNoel Grandin
2016-11-12Renaming due to the fact that it now dumps non-formula blocks too.Kohei Yoshida
2016-11-12Ctrl-Shift-F8 to dump the column storage where the cursor is.Kohei Yoshida
2016-11-11loplugin:countusersofdefaultparams in sc(part2)Noel Grandin
2016-11-08Resolves: tdf#103701 bulk-broadcast the correct hint ID for formula groupsEike Rathke
2016-11-07loplugin:expandablemethods in scNoel Grandin
2016-10-24Rename ClearFormulaContext() to make it more representative.Kohei Yoshida
2016-10-24tdf#100517 : Optionally include comment-only columns when sortingDennis Francis
2016-10-18tdf#89307: Removed T* SvRef::opeartor &()Jacek Fraczek
2016-10-18loplugin:unusedmethodsNoel Grandin
2016-10-11loplugin:constantfunctionNoel Grandin
2016-10-07Properly skip the hidden row(s) at the end.Kohei Yoshida
2016-10-05Remove _TYPED suffix from tools/link.hxx macrosStephan Bergmann