├── LICENSE ├── README.md ├── documentation ├── TabLanDataMappingSpecification_TIL_ver2.3_en.pdf ├── TabLanDocumentModellingMethodology_TIL_ver2.3_en.pdf ├── dot15926AdapterSample.pdf ├── dot15926Editor14_Vol1_GettingStarted.pdf ├── dot15926Editor14_Vol2_APIsScannerAndBuilder.pdf ├── dot15926Editor14_Vol3_Extensions.pdf ├── dot15926Editor15b_Vol4_PatternsAndMapping.pdf └── dot15926PlatformComplianceReport20120930.pdf ├── editor_qt ├── _ordereddict.pyd ├── dot15926.py ├── extensions │ ├── __init__.py │ ├── catalog │ │ ├── __init__.py │ │ ├── import_menu.py │ │ └── importer.py │ ├── examples │ │ ├── __init__.py │ │ ├── example_menu.py │ │ ├── text_con.py │ │ ├── text_doc.py │ │ ├── text_menu.py │ │ ├── text_view.py │ │ ├── transformation_commands.py │ │ └── transformation_main.py │ ├── geomtempl │ │ ├── __init__.py │ │ ├── import_menu.py │ │ └── importer.py │ ├── iringtempl │ │ ├── __init__.py │ │ ├── import_menu.py │ │ └── importer.py │ ├── patternimport │ │ ├── __init__.py │ │ └── import_menu.py │ ├── patternreport │ │ ├── __init__.py │ │ └── main.py │ ├── tablan │ │ ├── __init__.py │ │ ├── import_menu.py │ │ └── importer.py │ └── tipimport │ │ ├── __init__.py │ │ └── main.py ├── framework │ ├── __init__.py │ ├── about.py │ ├── appconfig.py │ ├── console.py │ ├── dialogs.py │ ├── docinfo.py │ ├── document.py │ ├── extensions.py │ ├── importmanager.py │ ├── log.py │ ├── menu.py │ ├── project.py │ ├── props.py │ ├── python_console.py │ ├── resources.py │ ├── settings.py │ ├── startpage.py │ ├── tree.py │ ├── treenode.py │ ├── util.py │ ├── view.py │ ├── workbench.py │ └── workbench_menu.py ├── graphlib.pyd ├── iso15926 │ ├── __init__.py │ ├── common │ │ ├── __init__.py │ │ ├── all_menu.py │ │ ├── dialogs.py │ │ ├── filteredview.py │ │ └── testing.py │ ├── graph │ │ ├── __init__.py │ │ ├── graph_actions.py │ │ ├── graph_document.py │ │ ├── graph_merge.py │ │ └── graph_view.py │ ├── io │ │ ├── __init__.py │ │ ├── rdf_base.py │ │ ├── rdf_graph.py │ │ ├── rdfxml_writer.py │ │ ├── sparql.py │ │ └── trig_writer.py │ ├── kb │ │ ├── __init__.py │ │ ├── dmviews.py │ │ ├── other_defs.py │ │ ├── part2_defs.py │ │ └── syntax_defs.py │ ├── patterns │ │ ├── __init__.py │ │ ├── patterns_actions.py │ │ ├── patterns_document.py │ │ └── patterns_view.py │ └── tools │ │ ├── __init__.py │ │ ├── builder.py │ │ ├── environment.py │ │ ├── patterns.py │ │ ├── scanner.py │ │ └── scantools.py ├── lib │ ├── README.txt │ ├── excel_reader.py │ └── pyodbc.pyd ├── patterns │ ├── patterns_iiptpl.patt │ ├── patterns_mmttpl.patt │ ├── patterns_p7tpl.patt │ ├── patterns_part2.patt │ ├── patterns_rdf.patt │ └── patterns_samples.patt └── resources │ ├── example.tm │ ├── ext.tm │ ├── images │ ├── Thumbs.db │ ├── arrow_down_green.png │ ├── arrow_up_green.png │ ├── blank_ico.png │ ├── check2.png │ ├── checks.png │ ├── console.png │ ├── copy.png │ ├── cross_gray.png │ ├── cross_red.png │ ├── cube_blue.png │ ├── cube_green.png │ ├── cube_yellow.png │ ├── cubes.png │ ├── cut.png │ ├── data_find.png │ ├── data_find_wip.png │ ├── delete.png │ ├── disk_blue.png │ ├── disk_blue_ok.png │ ├── disk_green.png │ ├── disks.png │ ├── document_triangle_green.png │ ├── dot_gray.png │ ├── dot_red.png │ ├── element.png │ ├── element_add.png │ ├── element_delete.png │ ├── element_warning.png │ ├── elephant.png │ ├── environment_view.png │ ├── environment_view2.png │ ├── error.png │ ├── error_small.png │ ├── exclamation-red.png │ ├── find_tpl.png │ ├── folder.png │ ├── gear.png │ ├── gears.png │ ├── grid.png │ ├── iso_annotation.png │ ├── iso_class.png │ ├── iso_class_i.png │ ├── iso_classofclass.png │ ├── iso_classofclass_i.png │ ├── iso_co_classofrel.png │ ├── iso_co_classofrel_i.png │ ├── iso_co_rel.png │ ├── iso_co_rel_i.png │ ├── iso_group.png │ ├── iso_group_find.png │ ├── iso_individual.png │ ├── iso_individual_i.png │ ├── iso_literal.png │ ├── iso_rel.png │ ├── iso_rel_i.png │ ├── iso_role.png │ ├── iso_spec_template.png │ ├── iso_syntax.png │ ├── iso_template.png │ ├── iso_template_c.png │ ├── iso_template_inst.png │ ├── iso_unknown.png │ ├── loading0.png │ ├── loading1.png │ ├── loading2.png │ ├── media_play_green.png │ ├── more.png │ ├── nav_down_green.png │ ├── nav_up_green.png │ ├── navigate_down.png │ ├── option_ico.png │ ├── paste.png │ ├── pattern_ico.png │ ├── patterns_doc.png │ ├── pin-small.png │ ├── plus.png │ ├── project_ico.png │ ├── rdf_ico.png │ ├── redo.png │ ├── refresh.png │ ├── tpl_ico.png │ ├── undo.png │ ├── view.png │ ├── warning_small.png │ └── window_new.png │ ├── locale │ └── ru │ │ └── LC_MESSAGES │ │ ├── dot15926_example.mo │ │ ├── dot15926_example.po │ │ ├── dot15926_ext.mo │ │ ├── dot15926_ext.po │ │ ├── dot15926_main.mo │ │ └── dot15926_main.po │ └── main.tm ├── feature_list.txt └── graphlib ├── _ordereddict ├── inc │ └── ordereddict.h └── lib │ ├── _ordereddict.lib │ ├── _ordereddict.pyd │ ├── _ordereddict_d.lib │ └── _ordereddict_d.pyd ├── base.c ├── base.h ├── graph.c ├── graph.h ├── graphitem.c ├── graphitem.h ├── graphlib.sln ├── graphlib.vcproj ├── main.c ├── raptor2 ├── inc │ └── raptor2.h └── lib │ ├── raptor2.lib │ └── raptor2_d.lib ├── rdf.h ├── rdfbase.c ├── rdfreader.c └── zlib ├── inc ├── zconf.h └── zlib.h └── lib ├── zdll.lib └── zlib.lib /README.md: -------------------------------------------------------------------------------- 1 | # dot15926 2 | 3 | Welcome to the .15926 Platform and Editor (pronounced “dot 15926”). 4 | 5 | .15925 Editor is a free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3.0 of the License, or (at your option) any later version. 6 | 7 | .15925 Editor is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 8 | 9 | Compiled versions of the software with extensive user documentation can be downloaded from http://techinvestlab.ru/dot15926Editor . Both stable version 1.43 and experimental version 1.5beta release 3 are available for download. Initial commit to this repository corresponds to the version 1.5beta release 3. 10 | 11 | .15926 Platform is a name for an architecture and a set of interfaces and libraries to work with semantic data in RDF format, and specifically with data compliant to the ISO 15926 standard. It is developed by TechInvestLab.ru to facilitate creation of semantic applications to work with data in all possible ways – read, visualize, explore, search, reason, map, write, exchange, etc. 12 | 13 | In .15926 Editor you can: 14 | 15 | • Browse ISO 15926 upper ontology in three different namespaces: PCA, RDS/WIP or ISO. 16 | 17 | • Search and navigate public ISO 15926 SPARQL endpoints, 18 | 19 | … or any other SPARQL endpoint you like, with authorization if required, 20 | 21 | … including search for legacy RDS/WIP identifiers. 22 | 23 | • Search, navigate and edit reference data files distributed publicly, including ISO 15926-4, PCA RDL and ISO 15926-8 templates, 24 | 25 | ... or any other RDF files you like in XML or Turtle. 26 | 27 | • Build complex data project from local files and endpoints, bringing reference data, template definitions and project data together for integrated navigation and verification, customizing namespaces, properties and meta-data attributes. 28 | 29 | • Design and run intricate semantic queries or whole data mining and verification algorithms for ISO 15926 data or any other RDF data, 30 | 31 | … using the power of Python general purpose programming language through full-featured REPL environment, 32 | 33 | … and accessing APIs of various .15926 Platform components to read, analyze and change reference and project data. 34 | 35 | • Create from scratch your own reference classes and templates, create project data (including template instances) manually or through your own adapters, 36 | 37 | … in forms ready for file exchange or upload to triple store, 38 | 39 | … generating URI in your namespaces using UUID compliant with RFC 4122 / ITU-T X.667 / ISO/IEC 9834-8. 40 | 41 | • Compare data sources, build diff files, review changes and create versioning system for reference and project data, or for any ontology. 42 | 43 | • Define data patterns, search for patterns in your data, and visualize search results, map spreadsheets to patterns. 44 | 45 | • Extend .15926 Editor functionality (develop your own mapping adapters for example) using Python, any external Python libraries and APIs of .15926 Platform components, 46 | 47 | … testing and debugging them in the .15926 Editor environment, 48 | 49 | … registering them as .15926 Editor extensions. 50 | 51 | • Use or modify extensions from TechInvestLab.ru: 52 | 53 | - pattern-based Linked Data semantic server with built-in web engine; 54 | 55 | - spreadsheet mapping to create semantic data from Excel spreadsheets; 56 | 57 | - conversion of reference and project data from TabLan.15926 data description tables (.xlsx) to ISO 15926 RDF; 58 | 59 | - import of reference data from JSON files created by engineering catalog application (third party); 60 | 61 | - creation or import of template definitions in iRING spreadsheet format. 62 | 63 | • Explore (with somewhat limited capabilities) any large RDF datasets, 64 | 65 | … OpenCYC knowledge base, for example. 66 | 67 | .15926 Editor is a tool designed with three major goals in mind: 68 | 69 | - explore existing sources of reference data in as many formats as possible; 70 | 71 | - verify reference data; 72 | 73 | - engineer and manage new reference data, including automated reference data creation through adaptors incorporating mapping from external sources. 74 | 75 | The Editor is intended to become for ISO 15926 data what Protégé became for OWL data – a primary tool for data exploration. 76 | 77 | The Editor is not designed to support any particular reference data management or data integration workflow. Specific applications for this can be built on .15926 Platform tailored to the requirements of organizations exchanging data – namespaces, endpoints, properties, databases, transport layers, etc. 78 | 79 | Mapping components are integrated in .15926 Platform environment as extensions using external or internal pattern mapping descriptions and directly accessing APIs of source/target databases. 80 | 81 | Please contact TechInvestLab.ru at dot15926@gmail.com for further details. 82 | -------------------------------------------------------------------------------- /documentation/TabLanDataMappingSpecification_TIL_ver2.3_en.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/documentation/TabLanDataMappingSpecification_TIL_ver2.3_en.pdf -------------------------------------------------------------------------------- /documentation/TabLanDocumentModellingMethodology_TIL_ver2.3_en.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/documentation/TabLanDocumentModellingMethodology_TIL_ver2.3_en.pdf -------------------------------------------------------------------------------- /documentation/dot15926AdapterSample.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/documentation/dot15926AdapterSample.pdf -------------------------------------------------------------------------------- /documentation/dot15926Editor14_Vol1_GettingStarted.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/documentation/dot15926Editor14_Vol1_GettingStarted.pdf -------------------------------------------------------------------------------- /documentation/dot15926Editor14_Vol2_APIsScannerAndBuilder.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/documentation/dot15926Editor14_Vol2_APIsScannerAndBuilder.pdf -------------------------------------------------------------------------------- /documentation/dot15926Editor14_Vol3_Extensions.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/documentation/dot15926Editor14_Vol3_Extensions.pdf -------------------------------------------------------------------------------- /documentation/dot15926Editor15b_Vol4_PatternsAndMapping.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/documentation/dot15926Editor15b_Vol4_PatternsAndMapping.pdf -------------------------------------------------------------------------------- /documentation/dot15926PlatformComplianceReport20120930.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/documentation/dot15926PlatformComplianceReport20120930.pdf -------------------------------------------------------------------------------- /editor_qt/_ordereddict.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/_ordereddict.pyd -------------------------------------------------------------------------------- /editor_qt/extensions/__init__.py: -------------------------------------------------------------------------------- 1 | """Copyright 2012 TechInvestLab.ru dot15926@gmail.com 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.""" -------------------------------------------------------------------------------- /editor_qt/extensions/catalog/__init__.py: -------------------------------------------------------------------------------- 1 | """Copyright 2012 TechInvestLab.ru dot15926@gmail.com 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.""" 23 | 24 | import extensions.catalog.import_menu -------------------------------------------------------------------------------- /editor_qt/extensions/catalog/import_menu.py: -------------------------------------------------------------------------------- 1 | """Copyright 2012 TechInvestLab.ru dot15926@gmail.com 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.""" 23 | 24 | from PySide.QtCore import * 25 | from PySide.QtGui import * 26 | from extensions.catalog.importer import CatalogImporter 27 | import iso15926.kb as kb 28 | from iso15926.graph.graph_document import GraphDocument 29 | from framework.document import Document 30 | import framework 31 | 32 | 33 | @public('workbench.menu.tools') 34 | class xCatalogDependencies: 35 | vis_label = tm.ext.menu_catalog 36 | menu_content = 'workbench.menu.catalog' 37 | 38 | @public('workbench.menu.catalog') 39 | class xCatalogDependencies: 40 | vis_label = tm.ext.menu_setup_catalog 41 | 42 | @staticmethod 43 | def Do(): 44 | DependenciesDialog() 45 | 46 | @public('workbench.menu.catalog') 47 | class xCatalogImport: 48 | vis_label = tm.ext.menu_import_catalog 49 | 50 | @staticmethod 51 | def Update(action): 52 | action.setEnabled(bool(appconfig.get('paths.p7tpl_catalog') and appconfig.get('paths.rdl_catalog') and appconfig.get('catalog.proj_ns'))) 53 | 54 | @classmethod 55 | def Do(cls): 56 | path, wildcard = framework.dialogs.SelectFiles(cls.vis_label, multi=False) 57 | if not path: 58 | return 59 | 60 | doc_rdf = GraphDocument() 61 | doc_rdf.NewImport([path], CatalogImporter, **(dict(chosen_part2=kb.ns_dm_part2, namespaces=kb.namespaces_std, annotations=kb.annotations_pcardl_rdf_til))) 62 | appdata.project.AddDocument(doc_rdf) 63 | 64 | from framework.util import FileBrowseButton 65 | 66 | class DependenciesDialog(QDialog): 67 | 68 | def __init__(self): 69 | QDialog.__init__(self, appdata.topwindow, Qt.WindowSystemMenuHint | Qt.WindowTitleHint) 70 | self.setWindowTitle(tm.ext.setup_catalog_title) 71 | 72 | self.p7tpl = FileBrowseButton(self, appconfig.get('paths.p7tpl_catalog', '')) 73 | self.pcardl = FileBrowseButton(self, appconfig.get('paths.rdl_catalog', '')) 74 | self.proj_ns = QLineEdit(appconfig.get('catalog.proj_ns', 'http://example.org/rdl/'), self) 75 | 76 | value = True if appconfig.get('catalog.attr_inheritance', 'True') == 'True' else False 77 | 78 | self.attr_inheritance = QCheckBox(self) 79 | self.attr_inheritance.setText(tm.ext.attr_inheritance) 80 | self.attr_inheritance.setChecked(value) 81 | 82 | grid = QGridLayout(self) 83 | grid.addWidget(QLabel(tm.ext.template_set_field, self), 0, 0) 84 | grid.addWidget(self.p7tpl, 0, 1) 85 | grid.addWidget(QLabel(tm.ext.rdl_field, self), 1, 0) 86 | grid.addWidget(self.pcardl, 1, 1) 87 | grid.addWidget(QLabel(tm.ext.ns_for_new_field, self), 2, 0) 88 | grid.addWidget(self.proj_ns, 2, 1) 89 | grid.addWidget(self.attr_inheritance, 3, 0, 1, 2) 90 | 91 | self.btn_ok = QPushButton(tm.ext.ok, self) 92 | self.btn_ok.setDefault(True) 93 | self.btn_cancel = QPushButton(tm.ext.cancel, self) 94 | self.btn_ok.clicked.connect(self.accept) 95 | self.btn_cancel.clicked.connect(self.reject) 96 | 97 | layout_btn = QHBoxLayout() 98 | layout_btn.addStretch(1) 99 | layout_btn.addWidget(self.btn_ok) 100 | layout_btn.addWidget(self.btn_cancel) 101 | 102 | grid.addLayout(layout_btn, 4, 0, 1, 2) 103 | 104 | 105 | if self.exec_()==QDialog.Accepted: 106 | appconfig['paths.p7tpl_catalog'] = str(self.p7tpl.GetPath()) 107 | appconfig['paths.rdl_catalog'] = str(self.pcardl.GetPath()) 108 | appconfig['catalog.proj_ns'] = str(self.proj_ns.text()) 109 | appconfig['catalog.attr_inheritance'] = str(self.attr_inheritance.isChecked()) 110 | appconfig.SaveSettings() 111 | -------------------------------------------------------------------------------- /editor_qt/extensions/examples/__init__.py: -------------------------------------------------------------------------------- 1 | """Copyright 2012 TechInvestLab.ru dot15926@gmail.com 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.""" 23 | 24 | import extensions.examples.example_menu 25 | import extensions.examples.text_doc 26 | import extensions.examples.text_view 27 | import extensions.examples.text_menu 28 | import extensions.examples.text_con 29 | import extensions.examples.transformation_main -------------------------------------------------------------------------------- /editor_qt/extensions/examples/example_menu.py: -------------------------------------------------------------------------------- 1 | """Copyright 2012 TechInvestLab.ru dot15926@gmail.com 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.""" 23 | 24 | """ 25 | To add a new menu item to main menu bar of the Editor declare new class with public('workbench.menubar') decorator. 26 | Class attributes: 27 | vis_label: Text label of new menu item in menu bar. 28 | menu_content: Path to sub-items. 29 | position: Index of item position in main menu, from 10 to 100. 30 | 31 | """ 32 | @public('workbench.menubar') 33 | class xTextMenu: 34 | vis_label = tm.example.menu_example_menu 35 | menu_content = 'dot15926.menu.example_menu' 36 | position = 10 -------------------------------------------------------------------------------- /editor_qt/extensions/examples/text_con.py: -------------------------------------------------------------------------------- 1 | """Copyright 2012 TechInvestLab.ru dot15926@gmail.com 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.""" 23 | 24 | """ 25 | This is an example of a simple console handler registration. 26 | 27 | When where is a TextView in focus, or no view in focus, but a document is selected in 28 | project, console command SetText('some string') will replace document content with 'some string'. 29 | """ 30 | 31 | from extensions.examples.text_doc import TextDoc 32 | 33 | class ConsoleTextSetter(object): 34 | 35 | def __call__(self, str): 36 | document = appdata.active_document 37 | view = appdata.active_view 38 | if view: 39 | document = view.document 40 | 41 | if document and isinstance(document, TextDoc): 42 | document.MyText = str 43 | 44 | appdata.console_locals['SetText'] = ConsoleTextSetter() -------------------------------------------------------------------------------- /editor_qt/extensions/examples/text_doc.py: -------------------------------------------------------------------------------- 1 | """Copyright 2012 TechInvestLab.ru dot15926@gmail.com 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.""" 23 | 24 | """ 25 | This is an example how simple view and edit functionality is implemented 26 | for a text file as extension to .15926 Editor. 27 | """ 28 | import framework 29 | from extensions.examples.text_view import TextView 30 | 31 | 32 | """Any document type should be registered in framework with the following decorator. 33 | It is necessary to guarantee document save and reload in configuration file.""" 34 | 35 | @public('dot15926.doctypes') 36 | class TextDoc(framework.Document): 37 | 38 | def __init__(self): 39 | """In constructor super class must be initialized 40 | and selected desired view type for document""" 41 | framework.Document.__init__(self) 42 | self.viewtype = type('', (TextView,), dict(document=self)) 43 | self.my_text = '' 44 | 45 | @property 46 | def MyText(self): 47 | return self.my_text 48 | 49 | @MyText.setter 50 | def MyText(self, value): 51 | text_changed = self.my_text != value 52 | self.my_text = value 53 | """Next lines switch state to state_changed, so document will be marked with star""" 54 | if text_changed: 55 | self.ChangeState(self.state_changed) 56 | """Rise event telling views that text was chenged""" 57 | wizard.W_TextDocChanged(self) 58 | 59 | def OpenFiles(self, paths, readonly=False, **props): 60 | """To properly register document in project 61 | this function must be overloaded.""" 62 | self.ChangeState(self.state_loading) 63 | """@public.wth() and @public.mth are threads decorators. 64 | public.wth is the worker thread while public.mth is the main. 65 | Here a trick how implement async loading for document""" 66 | @public.wth('Loading {0}...'.format(self.name), self) 67 | def f1(): 68 | try: 69 | text = '' 70 | for v in paths: 71 | with open(v, 'r') as f: 72 | text = text + f.read() 73 | @public.mth 74 | def f2(): 75 | """Note that here you should change state to actual value.""" 76 | self.MyText = text 77 | self.paths = paths 78 | self.ChangeState(self.state_loaded) 79 | except: 80 | log.exception() 81 | @public.mth 82 | def f3(): 83 | self.ChangeState(self.state_unavailable) 84 | 85 | def Save(self): 86 | if not self.CanSave(): 87 | return 88 | self.ChangeState(self.state_saving) 89 | @public.wth(tm.example.saving_doc.format(self.name), self) 90 | def f1(): 91 | try: 92 | with open(self.paths[0], 'w') as f: 93 | f.write(self.MyText) 94 | @public.mth 95 | def f2(): 96 | self.ChangeState(self.state_loaded) 97 | except: 98 | log.exception() 99 | @public.mth 100 | def f3(): 101 | self.ChangeState(self.state_unavailable) 102 | 103 | def SaveAs(self): 104 | if not self.CanSaveAs(): 105 | return 106 | path, wildcard = framework.dialogs.SaveAs() 107 | """Next line validates path - we don't want to overwrite opened file""" 108 | if not path or not self.VerifySavePath(path): 109 | return 110 | self.ChangeState(self.state_saving) 111 | @public.wth(tm.example.saving_doc.format(self.name), self) 112 | def f1(): 113 | try: 114 | with open(path, 'w') as f: 115 | f.write(self.MyText) 116 | @public.mth 117 | def f2(): 118 | self.paths = [path] 119 | self.ChangeState(self.state_loaded) 120 | except: 121 | log.exception() 122 | @public.mth 123 | def f3(): 124 | self.ChangeState(self.state_unavailable) -------------------------------------------------------------------------------- /editor_qt/extensions/examples/text_menu.py: -------------------------------------------------------------------------------- 1 | """Copyright 2012 TechInvestLab.ru dot15926@gmail.com 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.""" 23 | 24 | import extensions.examples.example_menu 25 | from extensions.examples.text_doc import TextDoc 26 | import framework.dialogs 27 | 28 | """ 29 | To add a sub-item to an item declare new class with public('') decorator, where is path to menu sub-item defined in menu item class. 30 | Class attributes: 31 | vis_label: Text label of new menu sub-item. 32 | Class methods: 33 | Update(cls, action): Update callback of QAction, passed as 'action' argument. 34 | Do(cls): Action required on menu click. 35 | 36 | """ 37 | @public('dot15926.menu.example_menu') 38 | class xTextMenuItem: 39 | vis_label = tm.example.menu_open_txt 40 | 41 | @classmethod 42 | def Do(cls): 43 | path, wildcard = framework.dialogs.SelectFiles(tm.example.open_txt_title) 44 | if not path: 45 | return 46 | 47 | doc = TextDoc() 48 | doc.OpenFiles([path]) 49 | appdata.project.AddDocument(doc) 50 | -------------------------------------------------------------------------------- /editor_qt/extensions/examples/text_view.py: -------------------------------------------------------------------------------- 1 | """Copyright 2012 TechInvestLab.ru dot15926@gmail.com 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.""" 23 | 24 | 25 | """ 26 | This is an example how simple text view functionality 27 | can be implemented as extension to .15926 Editor. 28 | """ 29 | from PySide.QtCore import * 30 | from PySide.QtGui import * 31 | import framework 32 | 33 | """View class should inherit from framework.View class 34 | Base class is subclass of QDockWidget with some additional methods. 35 | Feel free to use PySide broadly""" 36 | 37 | class TextView(framework.View): 38 | vis_label = tm.example.txt_view 39 | 40 | def __init__(self, parent): 41 | framework.View.__init__(self, parent) 42 | 43 | widget = QWidget(self) 44 | self.textfield = QTextEdit(widget) 45 | self.textfield.setText(self.document.MyText) 46 | self.textfield.textChanged.connect(self.OnText) 47 | layout = QVBoxLayout(widget) 48 | layout.addWidget(self.textfield) 49 | """wizard is event service, following 50 | line subscribes for event from target document""" 51 | wizard.Subscribe(self.document, self) 52 | self.setWidget(widget) 53 | 54 | def W_TextDocChanged(self, doc): 55 | """Here we handle subscribed event""" 56 | self.textfield.textChanged.disconnect(self.OnText) 57 | self.UpdateView() 58 | self.textfield.textChanged.connect(self.OnText) 59 | 60 | def OnText(self): 61 | wizard.Unsubscribe(self.document, self) 62 | self.document.MyText = self.textfield.toPlainText() 63 | wizard.Subscribe(self.document, self) 64 | 65 | def UpdateView(self): 66 | self.textfield.setText(self.document.MyText) 67 | 68 | def GetLabel(self): 69 | return self.vis_label 70 | 71 | def OnDestroy(self): 72 | wizard.Unsubscribe(self.document, self) 73 | -------------------------------------------------------------------------------- /editor_qt/extensions/examples/transformation_commands.py: -------------------------------------------------------------------------------- 1 | """Copyright 2012 TechInvestLab.ru dot15926@gmail.com 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.""" 23 | """ 24 | Here you can place Python code developed for the .15926 Editor console use 25 | """ 26 | 27 | with context("jord"): 28 | beguns=find(type=part2.ClassOfCauseOfBeginningOfClassOfIndividual, hasClassOfBegun=out) 29 | for element1 in beguns: 30 | causers=find(hasClassOfBegun=element1, hasClassOfCauser=out) 31 | for element2 in causers: 32 | with context("new_data"): 33 | p7tpl.ClassOfCauseOfBeginningOfClassOfIndividual(hasClassOfBegun=element1, hasClassOfCauser=element2) -------------------------------------------------------------------------------- /editor_qt/extensions/examples/transformation_main.py: -------------------------------------------------------------------------------- 1 | """Copyright 2012 TechInvestLab.ru dot15926@gmail.com 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.""" 23 | 24 | import extensions.examples.example_menu 25 | from iso15926 import EnvironmentContext, GraphDocument 26 | import framework.dialogs 27 | from PySide.QtCore import * 28 | from PySide.QtGui import * 29 | from framework.util import FileBrowseButton 30 | import os 31 | from iso15926 import kb 32 | 33 | class SetupTransformationDialog(QDialog): 34 | vis_label = 'Setup source and destination...' 35 | 36 | msg_source = 'Source:' 37 | msg_destionation = 'Destrination:' 38 | 39 | def __init__(self): 40 | QDialog.__init__(self, appdata.topwindow, Qt.WindowSystemMenuHint | Qt.WindowTitleHint) 41 | self.setWindowTitle(self.vis_label) 42 | 43 | self.source = FileBrowseButton(self) 44 | self.destionation = FileBrowseButton(self) 45 | 46 | grid = QGridLayout(self) 47 | grid.addWidget(QLabel(self.msg_source, self), 0, 0) 48 | grid.addWidget(self.source, 0, 1) 49 | grid.addWidget(QLabel(self.msg_destionation, self), 1, 0) 50 | grid.addWidget(self.destionation, 1, 1) 51 | 52 | self.btn_ok = QPushButton('Ok', self) 53 | self.btn_ok.setDefault(True) 54 | self.btn_cancel = QPushButton('Cancel', self) 55 | self.btn_ok.clicked.connect(self.accept) 56 | self.btn_cancel.clicked.connect(self.reject) 57 | 58 | layout_btn = QHBoxLayout() 59 | layout_btn.addStretch(1) 60 | layout_btn.addWidget(self.btn_ok) 61 | layout_btn.addWidget(self.btn_cancel) 62 | 63 | grid.addLayout(layout_btn, 2, 0, 1, 2) 64 | 65 | if self.exec_()==QDialog.Accepted: 66 | appconfig['paths.trans_sample_source'] = str(self.source.GetPath()) 67 | appconfig['paths.trans_sample_destination'] = str(self.destionation.GetPath()) 68 | appconfig.SaveSettings() 69 | 70 | @public('dot15926.menu.example_menu') 71 | class xTransformationMenuItem1: 72 | vis_label = 'Setup source and destination...' 73 | 74 | @staticmethod 75 | def Do(): 76 | SetupTransformationDialog() 77 | 78 | @public('dot15926.menu.example_menu') 79 | class xTransformationMenuItem2: 80 | vis_label = 'Do transformation' 81 | 82 | @staticmethod 83 | def Update(action): 84 | action.setEnabled(bool(appconfig.get('paths.trans_sample_source') and appconfig.get('paths.trans_sample_destination') and appconfig.get('tablan.trans_sample_script'))) 85 | 86 | @staticmethod 87 | def Do(): 88 | Transformation() 89 | 90 | class Transformation: 91 | 92 | def __init__(self): 93 | 94 | self.source_doc = GraphDocument.FindDocumentByPaths([appconfig.get('paths.trans_sample_source')]) 95 | if not self.source_doc: 96 | self.source_doc = GraphDocument() 97 | param = dict(module_name='jord', chosen_part2=kb.ns_dm_part2, namespaces=kb.namespaces_std, annotations=kb.annotations_pcardl_rdf) 98 | self.source_doc.OpenFiles([appconfig.get('paths.trans_sample_source')], **param) 99 | appdata.project.AddDocument(self.source_doc) 100 | 101 | self.dest_doc = GraphDocument.FindDocumentByPaths([appconfig.get('paths.trans_sample_destination')]) 102 | if not self.dest_doc: 103 | self.dest_doc = GraphDocument() 104 | param = dict(module_name='new_data', chosen_part2=kb.ns_dm_part2, namespaces=kb.namespaces_std_meta, annotations=kb.annotations_rdfs+kb.annotations_meta) 105 | if os.path.exists(appconfig.get('paths.trans_sample_destination')): 106 | self.dest_doc.OpenFiles([appconfig.get('paths.trans_sample_destination')], **param) 107 | else: 108 | self.dest_doc.NewFile(appconfig.get('paths.trans_sample_destination'), **param) 109 | appdata.project.AddDocument(self.dest_doc) 110 | 111 | ready = True 112 | 113 | if not self.source_doc.CanView(): 114 | wizard.Subscribe(self.source_doc, self) 115 | ready = False 116 | 117 | if not self.dest_doc.CanView(): 118 | wizard.Subscribe(self.dest_doc, self) 119 | ready = False 120 | 121 | if ready: 122 | appdata.app.After(self.DoTransformation) 123 | 124 | def W_DocumentStateChanged(self, doc): 125 | if doc.CanView(): 126 | wizard.Unsubscribe(doc, self) 127 | 128 | elif doc.IsUnavailable(): 129 | log('Transformation error: {0} unavailable!\n', doc.name) 130 | self.target_doc.ChangeState(self.target_doc.state_importfailed) 131 | wizard.Unsubscribe(doc, self) 132 | 133 | if self.source_doc.CanView() and self.dest_doc.CanView(): 134 | appdata.app.After(self.DoTransformation) 135 | 136 | def DoTransformation(self): 137 | context = EnvironmentContext(None, {}) 138 | context.ExecutePythonFile(os.path.join('extensions','examples','transformation_commands.py')) -------------------------------------------------------------------------------- /editor_qt/extensions/geomtempl/__init__.py: -------------------------------------------------------------------------------- 1 | """Copyright 2012 TechInvestLab.ru dot15926@gmail.com 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.""" 23 | 24 | import extensions.geomtempl.import_menu -------------------------------------------------------------------------------- /editor_qt/extensions/geomtempl/import_menu.py: -------------------------------------------------------------------------------- 1 | """Copyright 2012 TechInvestLab.ru dot15926@gmail.com 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.""" 23 | 24 | from PySide.QtCore import * 25 | from PySide.QtGui import * 26 | from extensions.geomtempl.importer import GeomImporter 27 | import iso15926.kb as kb 28 | import framework 29 | from iso15926 import GraphDocument 30 | import framework.dialogs 31 | 32 | @public('workbench.menu.tools') 33 | class xGeomImport: 34 | vis_label = tm.ext.menu_import_geom 35 | 36 | @staticmethod 37 | def Do(): 38 | SetupImportDialog() 39 | 40 | class SetupImportDialog(QDialog): 41 | 42 | def __init__(self): 43 | QDialog.__init__(self, appdata.topwindow, Qt.WindowSystemMenuHint | Qt.WindowTitleHint) 44 | self.setWindowTitle(tm.ext.import_geom_title) 45 | 46 | self.proj_ns = QLineEdit(appconfig.get('geom.proj_ns', 'http://example.org/tpl#'), self) 47 | 48 | self.name_uri = QCheckBox(self) 49 | self.name_uri.setText(tm.ext.uri_for_new_field) 50 | self.name_uri.setChecked(bool(appconfig.get('geom.uri_from_names', True))) 51 | 52 | grid = QGridLayout(self) 53 | grid.addWidget(QLabel(tm.ext.ns_for_new_field, self), 0, 0) 54 | grid.addWidget(self.proj_ns, 0, 1) 55 | grid.addWidget(self.name_uri, 1, 0, 1, 2) 56 | 57 | self.btn_ok = QPushButton(tm.ext.ok, self) 58 | self.btn_ok.setDefault(True) 59 | self.btn_cancel = QPushButton(tm.ext.cancel, self) 60 | self.btn_ok.clicked.connect(self.accept) 61 | self.btn_cancel.clicked.connect(self.reject) 62 | 63 | layout_btn = QHBoxLayout() 64 | layout_btn.addStretch(1) 65 | layout_btn.addWidget(self.btn_ok) 66 | layout_btn.addWidget(self.btn_cancel) 67 | 68 | grid.addLayout(layout_btn, 2, 0, 1, 2) 69 | 70 | if self.exec_()==QDialog.Accepted: 71 | appconfig['geom.proj_ns'] = str(self.proj_ns.text()) 72 | appconfig['geom.uri_from_names'] = self.name_uri.isChecked() 73 | appconfig.SaveSettings() 74 | 75 | path, wildcard = framework.dialogs.SelectFiles(tm.ext.select_xlsx, multi=False) 76 | if not path: 77 | return 78 | 79 | doc_template = GraphDocument() 80 | doc_template.NewImport([path], GeomImporter, **(dict(chosen_part2=kb.ns_dm_rds, namespaces=kb.namespaces_std, annotations=kb.annotations_rdfs_ex, basens=str(self.proj_ns.text()), uri_from_names=self.name_uri.isChecked()))) 81 | appdata.project.AddDocument(doc_template) 82 | 83 | -------------------------------------------------------------------------------- /editor_qt/extensions/geomtempl/importer.py: -------------------------------------------------------------------------------- 1 | """Copyright 2012 TechInvestLab.ru dot15926@gmail.com 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.""" 23 | 24 | import datetime 25 | import excel_reader 26 | import iso15926.kb as kb 27 | from iso15926 import SparqlConnection 28 | from iso15926 import GraphDocument 29 | 30 | @public('dot15926.importers') 31 | class GeomImporter: 32 | 33 | def __init__(self, target_doc, import_source): 34 | self.source_path = import_source[0] 35 | self.target_doc = target_doc 36 | self.DoImport() 37 | 38 | def InitEnvironment(self): 39 | environment = appdata.environment_manager.GetWorkEnvironment(self.target_doc, include_builder=True) 40 | self.builder = environment.get('builder', None) 41 | return self.builder 42 | 43 | def DoImport(self): 44 | if not self.InitEnvironment(): 45 | self.target_doc.ChangeState(self.target_doc.state_importfailed) 46 | return 47 | 48 | @public.wth(tm.ext.importing_doc.format(self.target_doc.name), self.target_doc) 49 | def f(): 50 | try: 51 | self.rd = excel_reader.ExcelReader(self.source_path) 52 | self.ProcessModel() 53 | @public.mth 54 | def f2(): 55 | self.target_doc.ChangeState(self.target_doc.state_changed) 56 | except: 57 | log.exception() 58 | @public.mth 59 | def f3(): 60 | self.target_doc.ChangeState(self.target_doc.state_importfailed) 61 | 62 | def ProcessModel(self): 63 | rd = self.rd 64 | builder = self.builder 65 | 66 | name_defs = {} 67 | 68 | base_templ = {} 69 | 70 | ann_targets = set() 71 | builder.set_uuid_prefix('R-') 72 | 73 | @rd.SafeRows('Class') 74 | def f(r): 75 | id = r.text('ID') 76 | label = r.text('Label') 77 | if label and id: 78 | name_defs[label] = id 79 | 80 | @rd.SafeRows('Base Template') 81 | def f(r): 82 | 83 | templateid = r.text('TemplateID') 84 | templatename = r.text('TemplateName') 85 | templatedescr = r.text('TemplateDescription') 86 | base_templ[templatename] = templateid 87 | ann_targets.add(builder.template(id = templateid, name = templatename, comment = templatedescr)) 88 | 89 | for i in xrange(1,8): 90 | idx = 'Role{0}'.format(i) 91 | roleid = r.text('{0}ID'.format(idx)) 92 | rolename = r.text('{0}Name'.format(idx)) 93 | if not rolename: 94 | continue 95 | roledesc = r.text('{0}Description'.format(idx)) 96 | rolevalue = r.text('{0}Value'.format(idx)) 97 | roletype = r.text('{0}Type'.format(idx)) 98 | if roletype.startswith('xsd:'): 99 | roletype = kb.ns_xsd+roletype[4:] 100 | else: 101 | roletype = name_defs.get(roletype) 102 | ann_targets.add(builder.template_role(roleid = roleid, name = rolename, comment = roledesc, type = roletype, value = name_defs.get(rolevalue))) 103 | 104 | for uri in ann_targets: 105 | if self.target_doc.uri_from_names: 106 | builder.annotate(id = uri, defaultRdsId = builder.UUID('R-')) 107 | else: 108 | builder.annotate(id = uri, defaultRdsId = kb.split_uri(uri)[1]) 109 | -------------------------------------------------------------------------------- /editor_qt/extensions/iringtempl/__init__.py: -------------------------------------------------------------------------------- 1 | """Copyright 2012 TechInvestLab.ru dot15926@gmail.com 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.""" 23 | 24 | import extensions.iringtempl.import_menu -------------------------------------------------------------------------------- /editor_qt/extensions/iringtempl/import_menu.py: -------------------------------------------------------------------------------- 1 | """Copyright 2012 TechInvestLab.ru dot15926@gmail.com 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.""" 23 | 24 | from extensions.iringtempl.importer import IRingImporter 25 | import iso15926.kb as kb 26 | import framework 27 | from iso15926 import GraphDocument 28 | import framework.dialogs 29 | 30 | @public('workbench.menu.tools') 31 | class xIRingImport: 32 | vis_label = tm.ext.menu_import_iringtempl 33 | 34 | @classmethod 35 | def Do(cls): 36 | path, wildcard = framework.dialogs.SelectFiles(cls.vis_label, multi=False) 37 | if not path: 38 | return 39 | 40 | doc_template = GraphDocument() 41 | doc_template.NewImport([path], IRingImporter, **(dict(chosen_part2=kb.ns_dm_rds, namespaces=kb.namespaces_std, annotations=kb.annotations_rdfs_ex, basens='http://tpl.rdlfacade.org/data#'))) 42 | appdata.project.AddDocument(doc_template) 43 | -------------------------------------------------------------------------------- /editor_qt/extensions/patternimport/__init__.py: -------------------------------------------------------------------------------- 1 | """Copyright 2012 TechInvestLab.ru dot15926@gmail.com 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.""" 23 | 24 | import extensions.patternimport.import_menu -------------------------------------------------------------------------------- /editor_qt/extensions/patternreport/__init__.py: -------------------------------------------------------------------------------- 1 | """Copyright 2012 TechInvestLab.ru dot15926@gmail.com 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.""" 23 | 24 | import extensions.patternreport.main -------------------------------------------------------------------------------- /editor_qt/extensions/tablan/__init__.py: -------------------------------------------------------------------------------- 1 | """Copyright 2012 TechInvestLab.ru dot15926@gmail.com 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.""" 23 | 24 | import extensions.tablan.import_menu -------------------------------------------------------------------------------- /editor_qt/extensions/tablan/import_menu.py: -------------------------------------------------------------------------------- 1 | """Copyright 2012 TechInvestLab.ru dot15926@gmail.com 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.""" 23 | 24 | from PySide.QtCore import * 25 | from PySide.QtGui import * 26 | from framework.util import FileBrowseButton 27 | from extensions.tablan.importer import TabLanImporter 28 | import iso15926.kb as kb 29 | import framework 30 | 31 | from iso15926 import GraphDocument 32 | 33 | from framework.document import Document 34 | import framework.dialogs 35 | 36 | @public('workbench.menu.tools') 37 | class xCatalogDependencies: 38 | vis_label = tm.ext.menu_tablan 39 | menu_content = 'workbench.menu.tablan' 40 | 41 | @public('workbench.menu.tablan') 42 | class xTabLanDependencies: 43 | vis_label = tm.ext.menu_setup_tablan 44 | 45 | @staticmethod 46 | def Do(): 47 | DependenciesDialog() 48 | 49 | @public('workbench.menu.tablan') 50 | class xTabLanImport: 51 | vis_label = tm.ext.menu_import_tablan 52 | 53 | @staticmethod 54 | def Update(action): 55 | action.setEnabled(bool(appconfig.get('paths.p7tpl_tablan') and appconfig.get('paths.rdl_tablan') and appconfig.get('tablan.proj_ns'))) 56 | 57 | @classmethod 58 | def Do(cls): 59 | path, wildcard = framework.dialogs.SelectFiles(cls.vis_label, multi=False) 60 | if not path: 61 | return 62 | 63 | doc_rdf = GraphDocument() 64 | doc_rdf.NewImport([path], TabLanImporter, **(dict(chosen_part2=kb.ns_dm_part2, namespaces=kb.namespaces_std, annotations=kb.annotations_pcardl_rdf_til))) 65 | appdata.project.AddDocument(doc_rdf) 66 | 67 | 68 | class DependenciesDialog(QDialog): 69 | vis_label = 'Setup TabLan dependencies...' 70 | msg_p7tpl = "Template set:" 71 | msg_pcardl = "RDL:" 72 | msg_ns = "Namespace for new entities:" 73 | 74 | def __init__(self): 75 | QDialog.__init__(self, appdata.topwindow, Qt.WindowSystemMenuHint | Qt.WindowTitleHint) 76 | self.setWindowTitle(tm.ext.setup_tablan_title) 77 | 78 | self.p7tpl = FileBrowseButton(self, appconfig.get('paths.p7tpl_tablan', '')) 79 | self.pcardl = FileBrowseButton(self, appconfig.get('paths.rdl_tablan', '')) 80 | self.proj_ns = QLineEdit(appconfig.get('tablan.proj_ns', 'http://example.org/rdl/'), self) 81 | 82 | grid = QGridLayout(self) 83 | grid.addWidget(QLabel(tm.ext.template_set_field, self), 0, 0) 84 | grid.addWidget(self.p7tpl, 0, 1) 85 | grid.addWidget(QLabel(tm.ext.rdl_field, self), 1, 0) 86 | grid.addWidget(self.pcardl, 1, 1) 87 | grid.addWidget(QLabel(tm.ext.ns_for_new_field, self), 2, 0) 88 | grid.addWidget(self.proj_ns, 2, 1) 89 | 90 | self.btn_ok = QPushButton(tm.ext.ok, self) 91 | self.btn_ok.setDefault(True) 92 | self.btn_cancel = QPushButton(tm.ext.cancel, self) 93 | self.btn_ok.clicked.connect(self.accept) 94 | self.btn_cancel.clicked.connect(self.reject) 95 | 96 | layout_btn = QHBoxLayout() 97 | layout_btn.addStretch(1) 98 | layout_btn.addWidget(self.btn_ok) 99 | layout_btn.addWidget(self.btn_cancel) 100 | 101 | grid.addLayout(layout_btn, 4, 0, 1, 2) 102 | 103 | if self.exec_()==QDialog.Accepted: 104 | appconfig['paths.p7tpl_tablan'] = str(self.p7tpl.GetPath()) 105 | appconfig['paths.rdl_tablan'] = str(self.pcardl.GetPath()) 106 | appconfig['tablan.proj_ns'] = str(self.proj_ns.text()) 107 | appconfig.SaveSettings() 108 | 109 | -------------------------------------------------------------------------------- /editor_qt/extensions/tipimport/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions 6 | are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | 2. Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 15 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 18 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | """ 25 | 26 | 27 | import extensions.tipimport.main -------------------------------------------------------------------------------- /editor_qt/framework/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | """ 18 | 19 | 20 | def Initialize(): 21 | import framework.document 22 | import framework.view 23 | framework.Document = framework.document.Document 24 | framework.View = framework.view.View 25 | -------------------------------------------------------------------------------- /editor_qt/framework/about.py: -------------------------------------------------------------------------------- 1 | """ 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | """ 18 | 19 | 20 | 21 | from PySide.QtCore import * 22 | from PySide.QtGui import * 23 | import requests 24 | import re 25 | import framework.dialogs 26 | 27 | class AboutBox(QDialog): 28 | 29 | def __init__(self): 30 | QDialog.__init__(self, appdata.topwindow, Qt.WindowSystemMenuHint | Qt.WindowTitleHint) 31 | 32 | self.setWindowTitle('%s %s'%(tm.main.about, appdata.app.vis_label)) 33 | layout = QVBoxLayout(self) 34 | 35 | layout.addWidget(QLabel(appdata.app.vis_label, self)) 36 | layout.addWidget(QLabel(tm.main.copyright, self)) 37 | layout.addWidget(QLabel(tm.main.distribution, self)) 38 | 39 | text = QLabel('%s'%tm.main.community, self) 40 | text.setTextFormat(Qt.RichText) 41 | text.setTextInteractionFlags(Qt.TextBrowserInteraction) 42 | text.setOpenExternalLinks(True) 43 | layout.addWidget(text) 44 | 45 | button = QPushButton(tm.main.ok, self) 46 | layout.addWidget(button, 0, Qt.AlignRight) 47 | 48 | button.setDefault(True) 49 | button.clicked.connect(self.accept) 50 | self.exec_() 51 | 52 | 53 | @public('workbench.menu.help') 54 | class xAbout: 55 | vis_label = tm.main.menu_about 56 | @staticmethod 57 | def Do(): 58 | AboutBox() 59 | 60 | 61 | 62 | @public('workbench.menu.help') 63 | class xVersionCheck: 64 | vis_label = tm.main.version_check 65 | @staticmethod 66 | def Do(): 67 | try: 68 | r = requests.get('http://techinvestlab.ru/editorversioninfo') 69 | if r.status_code == 200: 70 | m = re.search(r'(version) (\d+.\d+)', r.content) 71 | if m != None: 72 | version = float(m.group(2)) 73 | if version > appdata.app_version: 74 | if framework.dialogs.Choice(tm.main.update_version_question.format(version)): 75 | QDesktopServices.openUrl('http://techinvestlab.ru/dot15926Editor') 76 | else: 77 | framework.dialogs.Notify(tm.main.latest_version) 78 | else: 79 | raise 80 | except: 81 | framework.dialogs.Notify(tm.main.version_check_failed) 82 | -------------------------------------------------------------------------------- /editor_qt/framework/appconfig.py: -------------------------------------------------------------------------------- 1 | """ 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | """ 18 | 19 | 20 | 21 | 22 | import json 23 | import collections 24 | import traceback 25 | import os 26 | 27 | class ConfigVersionConverter: 28 | version = 4 29 | 30 | @staticmethod 31 | def Version0(data): 32 | if data.get('solutiondata', None) != None: 33 | data['projectdata'] = data['solutiondata'] 34 | del data['solutiondata'] 35 | 36 | @staticmethod 37 | def Version1(data): 38 | if data.get('projectdata', None) != None: 39 | for v in data['projectdata']: 40 | if isinstance(v, dict): 41 | if 'is_templates' in v['info']: 42 | v['info']['doc_type'] = 'TemplatesDocument' 43 | del v['info']['is_templates'] 44 | if 'is_graph' in v['info']: 45 | v['info']['doc_type'] = 'GraphDocument' 46 | del v['info']['is_graph'] 47 | if 'importer_name' in v['info']: 48 | v['info']['importer_type'] = v['info']['importer_name'] 49 | del v['info']['importer_name'] 50 | 51 | @staticmethod 52 | def Version2(data): 53 | from framework.project import ProjectView 54 | from framework.dialogs import Notify, SelectFiles, Choice 55 | projectdata = data.get('projectdata') 56 | if projectdata: 57 | Notify(_('Project data found in configuration. Please save it as project file.')) 58 | del data['projectdata'] 59 | while True: 60 | path = SelectFiles(tm.main.save_project_as, save = True, wildcard = ProjectView.msg_wildcard) 61 | if path: 62 | try: 63 | with open(path, 'w') as f: 64 | json.dump(dict(data=projectdata), f, 'utf-8', ensure_ascii=False) 65 | data['projectfile'] = path 66 | break 67 | except: 68 | if not Choice(tm.main.config_convert_project_file_failed): 69 | break 70 | else: 71 | if Choice(tm.main.config_abort_project_convert): 72 | break 73 | 74 | @staticmethod 75 | def Version3(data): 76 | data['cfg://part4'] = data.pop('paths.part4', '') 77 | data['cfg://pca_rdl'] = data.pop('paths.pca_rdl', '') 78 | data['cfg://p7tpl'] = data.pop('paths.p7tpl', '') 79 | 80 | from framework.util import DictDecoder 81 | 82 | class AppConfig(dict): 83 | configfile = os.path.join(appdata.app_dir, 'dot15926.cfg') 84 | 85 | def _key_hook(self, key): 86 | if key == 'cfg://patterns': 87 | return 'patterns' 88 | 89 | def get(self, key, default = None): 90 | result = self._key_hook(key) 91 | if result != None: 92 | return result 93 | return dict.get(self, key, default) 94 | 95 | def __missing__(self, key): 96 | result = self._key_hook(key) 97 | if result != None: 98 | return result 99 | raise KeyError(key) 100 | 101 | def TryToLoadSettings(self): 102 | try: 103 | with open(self.configfile, 'r') as f: 104 | self.update(json.load(f, 'utf-8', object_hook = DictDecoder())) 105 | except: 106 | self.SaveSettings() 107 | 108 | def SaveSettings(self): 109 | with open(self.configfile, 'w') as f: 110 | json.dump(self, f, 'utf-8', ensure_ascii=False) 111 | 112 | def CheckVersion(self): 113 | version = self.get('version', 0) 114 | if version != ConfigVersionConverter.version: 115 | for i in range(version, ConfigVersionConverter.version): 116 | convert_method = getattr(ConfigVersionConverter, 'Version{0}'.format(i), None) 117 | if convert_method != None: 118 | convert_method(self) 119 | self['version'] = ConfigVersionConverter.version 120 | self.SaveSettings() -------------------------------------------------------------------------------- /editor_qt/framework/dialogs.py: -------------------------------------------------------------------------------- 1 | """ 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | """ 18 | 19 | 20 | 21 | 22 | from PySide.QtCore import * 23 | from PySide.QtGui import * 24 | import os 25 | 26 | def SelectFiles(header, multi=False, save=False, defaultDir = '', defaultFile = '', wildcard = None, wildcard_default = None): 27 | if not defaultDir: 28 | defaultDir = appconfig.get('browse_dir', '') 29 | 30 | path = os.path.join(defaultDir, str(defaultFile).translate(None, '\\/:*?"<>|')) 31 | 32 | if save: 33 | result, wildcard = QFileDialog.getSaveFileName(appdata.topwindow, header, path, wildcard, wildcard_default) 34 | elif multi: 35 | result, wildcard = QFileDialog.getOpenFileNames(appdata.topwindow, header, path, wildcard, wildcard_default) 36 | else: 37 | result, wildcard = QFileDialog.getOpenFileName(appdata.topwindow, header, path, wildcard, wildcard_default) 38 | 39 | if result: 40 | if isinstance(result, basestring): 41 | result = os.path.normpath(result) 42 | appconfig['browse_dir'] = os.path.dirname(result) 43 | else: 44 | for i, v in enumerate(result): 45 | result[i] = os.path.normpath(v) 46 | appconfig['browse_dir'] = os.path.dirname(result[0]) 47 | appconfig.SaveSettings() 48 | 49 | return result, wildcard 50 | 51 | def SaveAs(defaultFile = '', wildcard = None, wildcard_default = None): 52 | return SelectFiles(tm.main.save_as, save=True, defaultFile=defaultFile, wildcard=wildcard, wildcard_default=wildcard_default) 53 | 54 | def SaveSnapshot(defaultFile = '', wildcard = None, wildcard_default = None): 55 | return SelectFiles(tm.main.save_snapshot, save=True, defaultFile=defaultFile, wildcard=wildcard, wildcard_default=wildcard_default) 56 | 57 | def EnterText(title, prompt): 58 | text, ok = QInputDialog.getText(appdata.topwindow, title, prompt, flags = Qt.WindowSystemMenuHint | Qt.WindowTitleHint) 59 | if ok: 60 | return text 61 | else: 62 | return None 63 | 64 | def Notify(text): 65 | QMessageBox.information(appdata.topwindow, tm.main.notification, text) 66 | 67 | def Choice(text): 68 | return QMessageBox.Ok == QMessageBox.question(appdata.topwindow, tm.main.notification, text, QMessageBox.Ok | QMessageBox.Cancel) 69 | 70 | class MultilinePropertyDialog(QDialog): 71 | def __init__(self, label='', ): 72 | QDialog.__init__(self, appdata.topwindow, Qt.WindowSystemMenuHint | Qt.WindowTitleHint) 73 | self.setWindowTitle(label) 74 | 75 | class OkCancelDialog(QDialog): 76 | def __init__(self, label=''): 77 | QDialog.__init__(self, appdata.topwindow, Qt.WindowSystemMenuHint | Qt.WindowTitleHint) 78 | self.setWindowTitle(label) 79 | 80 | def keyPressEvent(self, evt): 81 | QDialog.keyPressEvent(self, evt) 82 | if evt.key() == Qt.Key_Return or evt.key() == Qt.Key_Enter: 83 | if evt.modifiers() & Qt.ControlModifier: 84 | self.accept() 85 | else: 86 | widget = QApplication.focusWidget() 87 | if isinstance(widget, QAbstractButton) and self.isAncestorOf(widget): 88 | widget.animateClick() 89 | 90 | def AddButtons(self, layout): 91 | self.btn_ok = QPushButton(tm.main.ok, self) 92 | self.btn_cancel = QPushButton(tm.main.cancel, self) 93 | self.btn_ok.clicked.connect(self.accept) 94 | self.btn_cancel.clicked.connect(self.reject) 95 | self.btn_ok.setAutoDefault(False) 96 | self.btn_cancel.setAutoDefault(False) 97 | layout_btn = QHBoxLayout() 98 | layout_btn.addStretch(1) 99 | layout_btn.addWidget(self.btn_ok) 100 | layout_btn.addWidget(self.btn_cancel) 101 | layout.addLayout(layout_btn) 102 | 103 | class PopDialog(QDialog): 104 | def __init__(self, parent, size=None, pos=None, label=''): 105 | QDialog.__init__(self, parent, Qt.WindowSystemMenuHint | Qt.WindowTitleHint) 106 | self.setWindowTitle(label) 107 | 108 | def changeEvent(self, evt): 109 | if evt.type() == QEvent.WindowStateChange: 110 | if not windowState() & Qt.WindowActive: 111 | self.Leaving() 112 | self.accepted() 113 | 114 | def Leaving(self): 115 | pass 116 | 117 | class TextPopDialog(PopDialog): 118 | def __init__(self, parent, pos, text, callback): 119 | PopDialog.__init__(self, parent) 120 | 121 | textc = QPlainTextEdit(self) 122 | self.textctrl = textc 123 | self.callback = callback 124 | textc.setFont(parent.font()) 125 | textc.textChanged.connect(self.OnChanged) 126 | textc.returnPressed.connect(self.OnEnter) 127 | textc.setText(text) 128 | self.exec_() 129 | 130 | def OnChanged(self, event): 131 | textc = self.textctrl 132 | metrics = textc.fontMetrics() 133 | size = metrics.size(Qt.TextExpandTab, textc.text()+u'MM') 134 | size = (size[0], size[1]+4) 135 | self.setFixedSize(size) 136 | self.textctrl.setFixedSize(size) 137 | 138 | def OnEnter(self, event): 139 | if self.callback: 140 | self.callback(self.textctrl.GetValue()) 141 | self.callback = None 142 | self.Close() 143 | 144 | def keyPressEvent(self, evt): 145 | if evt.key() == Qt.Key_Escape: 146 | evt.accept() 147 | if self.callback: 148 | self.callback(None) 149 | self.callback = None 150 | self.reject() 151 | 152 | def Leaving(self): 153 | if self.callback: 154 | self.callback(None) 155 | self.callback = None 156 | -------------------------------------------------------------------------------- /editor_qt/framework/docinfo.py: -------------------------------------------------------------------------------- 1 | """ 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | """ 18 | 19 | 20 | 21 | import os 22 | import framework.dialogs as dialogs 23 | from framework.util import GetPath, Path2Name 24 | 25 | class DocInfoVersionConverter: 26 | version = 2 27 | @staticmethod 28 | def Check(docinfo): 29 | version = docinfo.get('version', 0) 30 | if version != DocInfoVersionConverter.version: 31 | for i in xrange(version, DocInfoVersionConverter.version): 32 | convert_method = getattr(DocInfoVersionConverter, 'Version{0}'.format(i), None) 33 | if convert_method != None: 34 | convert_method(docinfo) 35 | 36 | @staticmethod 37 | def Version0(docinfo): 38 | if docinfo['info']['doc_type'] == 'TemplatesDocument': 39 | docinfo['info']['doc_type'] = 'GraphDocument' 40 | 41 | @staticmethod 42 | def Version1(docinfo): 43 | for k, v in docinfo['params'].iteritems(): 44 | if k in ('annotations', 'roles', 'namespaces'): 45 | docinfo['params'][k] = [tuple(line.split(' ', 1)) for line in v.splitlines()] 46 | 47 | 48 | def CollectDocInfo(document, base_path = None): 49 | 50 | is_valid = False 51 | docinfo = dict() 52 | docinfo['version'] = DocInfoVersionConverter.version 53 | docinfo['params'] = dict() 54 | docinfo['info'] = dict() 55 | 56 | docinfo['info']['doc_type'] = document.__class__.__name__ 57 | docinfo['name'] = document.name 58 | 59 | for k in document.doc_params: 60 | v = getattr(document, k, None) 61 | if v != None: 62 | if k in ('annotations', 'roles', 'namespaces'): 63 | docinfo['params'][k] = [list(value) for value in v] 64 | else: 65 | docinfo['params'][k] = v 66 | 67 | connection = getattr(document, 'doc_connection', None) 68 | importer = getattr(document, 'importer_type', None) 69 | 70 | if connection: 71 | docinfo['info']['connection'] = {'uri': connection.uri, 'login': connection.login, 'password': connection.password} 72 | is_valid = True 73 | elif len(document.doc_paths) > 0: 74 | if base_path: 75 | try: 76 | base_dir = os.path.dirname(base_path) 77 | docinfo['info']['paths'] = [p if p.startswith('cfg://') else os.path.relpath(p, base_dir) for p in document.doc_paths] 78 | except: 79 | docinfo['info']['paths'] = document.doc_paths 80 | else: 81 | docinfo['info']['paths'] = document.doc_paths 82 | is_valid = True 83 | 84 | if importer: 85 | docinfo['info']['importer_name'] = importer.__name__ 86 | docinfo['info']['import_source'] = document.import_source 87 | docinfo['info']['importer_kwargs'] = document.importer_kwargs 88 | is_valid = True 89 | 90 | if is_valid: 91 | return docinfo 92 | else: 93 | return None 94 | 95 | def OpenDoc(docinfo, base_path = None): 96 | 97 | DocInfoVersionConverter.Check(docinfo) 98 | 99 | info = docinfo['info'] 100 | params = docinfo['params'] 101 | 102 | doctype = None 103 | doc_typename = info['doc_type'] 104 | for v in public.all("dot15926.doctypes"): 105 | if v.__name__ == doc_typename: 106 | doctype = v 107 | 108 | if doctype == None: 109 | return 110 | 111 | doc = doctype() 112 | from_file = False 113 | if 'paths' in info: 114 | if base_path: 115 | base_dir = os.path.dirname(base_path) 116 | paths = [p if p.startswith('cfg://') or os.path.isabs(p) else os.path.normpath(os.path.join(base_dir, p)) for p in info['paths']] 117 | else: 118 | paths = info['paths'] 119 | 120 | not_found = [] 121 | for i, p in enumerate([GetPath(v) for v in paths]): 122 | if not os.path.exists(p): 123 | not_found.append((i, p)) 124 | 125 | if not_found: 126 | if dialogs.Choice(tm.main.paths_not_found%'\n'.join([Path2Name(p) for v in not_found])): 127 | new_paths, wildcard = dialogs.SelectFiles(tm.main.paths_not_found_select, multi=True) 128 | if new_paths: 129 | for i, p in reversed(not_found): 130 | paths.pop(i) 131 | paths += new_paths 132 | else: 133 | return 134 | 135 | if not doctype.VerifyEditablePaths([v.decode('utf-8') for v in [appconfig.get(v, '').decode('utf-8') if v.startswith('cfg://') else v for v in paths]]): 136 | return 137 | 138 | doc.OpenFiles([v.decode('utf-8') for v in paths], **params) 139 | from_file = True 140 | elif 'connection' in info: 141 | from iso15926.io.sparql import SparqlConnection 142 | connection = SparqlConnection(**info['connection']) 143 | doc.OpenSparql(connection, **params) 144 | if 'importer_name' in info: 145 | importer_name = info['importer_name'] 146 | for v in public.all("dot15926.importers"): 147 | if v.__name__ == importer_name: 148 | doc.NewImport([path.decode('utf-8') for path in info['import_source']], v, info['importer_kwargs'], reimport = (from_file == False), **params) 149 | 150 | 151 | return doc 152 | 153 | def NameWithPrefix(docinfo): 154 | return docinfo['name'] 155 | 156 | def CompareDocSources(first, second): 157 | if first == second: 158 | return True 159 | 160 | if first['info']['doc_type'] != second['info']['doc_type']: 161 | return False 162 | 163 | if 'paths' in first['info'] or 'paths' in second['info']: 164 | return first['info'].get('paths') == second['info'].get('paths') 165 | elif 'importer_name' in first['info'] or 'importer_name' in second['info']: 166 | return first['info'].get('import_source') == second['info'].get('import_source') 167 | elif 'connection' in first['info'] and 'connection' in second['info']: 168 | return first['info']['connection']['uri'] == second['info']['connection']['uri'] 169 | return False 170 | 171 | def GetDocSource(doc): 172 | if 'paths' in doc['info']: 173 | return ', '.join(doc['info']['paths']) 174 | if 'importer_name' in doc['info']: 175 | return ', '.join(doc['info']['import_source']) 176 | elif 'connection' in doc['info']: 177 | return doc['info']['connection']['uri'] 178 | return '' -------------------------------------------------------------------------------- /editor_qt/framework/extensions.py: -------------------------------------------------------------------------------- 1 | """ 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | """ 18 | 19 | 20 | import os 21 | import framework.log 22 | 23 | class ExtensionManager: 24 | extensions_path = 'extensions' 25 | 26 | def __init__(self): 27 | self.extensions = {} 28 | pass 29 | 30 | def LoadExtensions(self): 31 | extensions_settings = appconfig.setdefault('extensions', {}) 32 | found_extensions = [] 33 | 34 | lst = os.listdir(self.extensions_path) 35 | for v in lst: 36 | if v == '__init__.py': 37 | continue 38 | 39 | path = self.extensions_path + os.sep + v 40 | if os.path.isdir(path): 41 | name = v 42 | module_name = self.extensions_path + '.' + v 43 | elif v.endswith('.py'): 44 | name = v[:-3] 45 | module_name = self.extensions_path + '.' + v[:-3] 46 | else: 47 | continue 48 | 49 | found_extensions.append(name) 50 | 51 | if name in extensions_settings: 52 | if not extensions_settings[name]: 53 | log( 'Skipping extension {0}\n'.format(name) ) 54 | continue 55 | else: 56 | if name in ('examples'): 57 | extensions_settings[name] = False 58 | continue 59 | 60 | extensions_settings[name] = True 61 | 62 | log( 'Loading extension {0}\n'.format(name) ) 63 | 64 | try: 65 | __import__(module_name) 66 | except: 67 | log.exception() 68 | 69 | for k in extensions_settings.copy().iterkeys(): 70 | if k not in found_extensions: 71 | del extensions_settings[k] 72 | 73 | appconfig.SaveSettings() 74 | 75 | 76 | -------------------------------------------------------------------------------- /editor_qt/framework/importmanager.py: -------------------------------------------------------------------------------- 1 | """ 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | """ 18 | 19 | 20 | 21 | 22 | try: 23 | import builtins 24 | except ImportError: 25 | import __builtin__ as builtins 26 | 27 | import imp 28 | import sys 29 | import traceback 30 | 31 | class ImportManager: 32 | 33 | _baseimport = builtins.__import__ 34 | _dependencies = dict() 35 | _parent = None 36 | 37 | @staticmethod 38 | def enable(blacklist=None): 39 | builtins.__import__ = ImportManager._import 40 | 41 | @staticmethod 42 | def disable(): 43 | """Disable global module dependency tracking.""" 44 | builtins.__import__ = ImportManager._baseimport 45 | ImportManager._dependencies.clear() 46 | ImportManager._parent = None 47 | 48 | @staticmethod 49 | def GetDependencies(m): 50 | """Get the dependency list for the given imported module.""" 51 | return ImportManager._dependencies.get(m.__name__, []) 52 | 53 | @staticmethod 54 | def _import(name, globals=None, locals=None, fromlist=None, level=-1): 55 | """__import__() replacement function that tracks module dependencies.""" 56 | # Track our current parent module. This is used to find our current place 57 | # in the dependency graph. 58 | parent = ImportManager._parent 59 | ImportManager._parent = name 60 | 61 | base = None 62 | try: 63 | # Perform the actual import using the base import function. 64 | base = ImportManager._baseimport(name, globals, locals, fromlist, level) 65 | except: 66 | raise 67 | else: 68 | # If this is a nested import for a reloadable (source-based) module, we 69 | # append ourself to our parent's dependency list. 70 | 71 | if parent is not None: 72 | # We get the module directly from sys.modules because the import 73 | # function only returns the top-level module reference for a nested 74 | # import statement (e.g. 'package' for `import package.module`). 75 | parent_module = sys.modules.get(parent, None) 76 | if parent_module is not None and hasattr(parent_module, '__file__'): 77 | l = ImportManager._dependencies.setdefault(name, []) 78 | if parent_module not in l: 79 | l.append(parent_module) 80 | 81 | # Lastly, we always restore our global _parent pointer. 82 | finally: 83 | ImportManager._parent = parent 84 | 85 | return base 86 | 87 | -------------------------------------------------------------------------------- /editor_qt/framework/log.py: -------------------------------------------------------------------------------- 1 | """ 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | """ 18 | 19 | 20 | 21 | 22 | import sys 23 | import time 24 | import datetime 25 | import pprint 26 | import traceback 27 | import inspect 28 | import threading 29 | from PySide.QtCore import * 30 | import re 31 | 32 | expr1 = re.compile(r'^(.)', re.MULTILINE) 33 | expr2 = re.compile(r'.^(.)', re.MULTILINE) 34 | 35 | class Log: 36 | 37 | def __init__(self): 38 | self.opened = False 39 | self.filename = None 40 | self.output = None 41 | self.pre = [] 42 | self.newline = True 43 | 44 | def exception(self): 45 | self.write(traceback.format_exc()) 46 | 47 | def info(self, fmt = '', offset = 1): 48 | callerframerecord = inspect.stack()[offset] 49 | frame = callerframerecord[0] 50 | info = inspect.getframeinfo(frame) 51 | filename = info.filename 52 | lineno = info.lineno 53 | self.write('<%s:%s>\n%s'%(filename, lineno, fmt)) 54 | 55 | def line(self): 56 | callerframerecord = inspect.stack()[1] 57 | frame = callerframerecord[0] 58 | info = inspect.getframeinfo(frame) 59 | lineno = info.lineno 60 | self.write('line: %i\n'%lineno) 61 | 62 | def stack(self): 63 | data = ''.join(traceback.format_stack()[:-2]) 64 | self.write(data) 65 | 66 | def now(self): 67 | self.time = -1 68 | self.write('') 69 | 70 | def open(self, filename=None): 71 | self.old_stderr = sys.stderr 72 | self.old_stdout = sys.stdout 73 | sys.stderr = self 74 | sys.stdout = self 75 | self.filename = filename 76 | self.opened = True 77 | if self.filename: 78 | with open(self.filename, 'w') as f: 79 | pass 80 | self('Date: ') 81 | self(datetime.datetime.now().strftime("%Y-%m-%d\n")) 82 | 83 | def setoutput(self, output): 84 | self.output = output 85 | self.output(''.join(self.pre)) 86 | 87 | def close(self): 88 | if self.opened: 89 | sys.stderr = self.old_stderr 90 | sys.stdout = self.old_stdout 91 | self.opened = False 92 | self.filename = None 93 | 94 | def p(self, data): 95 | self.write(pprint.pformat(data)) 96 | 97 | def __call__(self, fmt, *t): 98 | if t: 99 | fmt = fmt.format(*t) 100 | self.write(fmt) 101 | return self 102 | 103 | def rep(self, fmt, *t): 104 | if t: 105 | fmt = fmt.format(*t) 106 | self.write(fmt) 107 | 108 | def write(self, text): 109 | time = datetime.datetime.now() 110 | if threading.currentThread() == appdata.main_thread: 111 | self._write(text, time) 112 | else: 113 | @public.mth 114 | def f(): 115 | self._write(text, time) 116 | 117 | def _write(self, text, time = None): 118 | if time: 119 | timestamp = '[%s]: \\1'%(time.strftime("%H:%M:%S.%f")[:-3]) 120 | if self.newline: 121 | text = re.sub(expr1, timestamp, text) 122 | else: 123 | text = re.sub(expr2, timestamp, text) 124 | self.newline = text.endswith('\n') 125 | 126 | try: 127 | if self.old_stdout.encoding: 128 | std_text = text.encode(self.old_stdout.encoding, 'ignore') 129 | else: 130 | std_text = text 131 | self.old_stdout.write(std_text) 132 | except: 133 | pass 134 | 135 | if self.filename: 136 | with open(self.filename, 'ab') as f: 137 | f.write(text) 138 | self.pre.append(text) 139 | if self.output: 140 | self.output(text) 141 | 142 | if not getattr(sys.modules['__builtin__'], 'log', None): 143 | sys.modules['__builtin__'].log = Log() 144 | -------------------------------------------------------------------------------- /editor_qt/framework/menu.py: -------------------------------------------------------------------------------- 1 | """ 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | """ 18 | 19 | 20 | 21 | 22 | from PySide.QtCore import * 23 | from PySide.QtGui import * 24 | import framework.resources 25 | 26 | class Menu(QMenu): 27 | def __init__(self, parent = None): 28 | QMenu.__init__(self, parent) 29 | self.aboutToShow.connect(self.OnAboutToShow) 30 | 31 | self.timer = QTimer(self) 32 | self.timer.timeout.connect(self.UpdateActions) 33 | self.timer.start(200) 34 | 35 | def OnAboutToShow(self): 36 | if getattr(self, 'make', None): 37 | self.make(self) 38 | self.UpdateActions() 39 | 40 | def UpdateActions(self): 41 | actions = self.actions() 42 | for v in actions: 43 | if getattr(v, 'update', None): 44 | v.update(v) 45 | 46 | class ToolBar(QToolBar): 47 | def __init__(self, title, parent = None): 48 | QToolBar.__init__(self, title, parent) 49 | self.timer = QTimer(self) 50 | self.timer.timeout.connect(self.updateActions) 51 | self.timer.start(200) 52 | 53 | def updateActions(self): 54 | actions = self.actions() 55 | for v in actions: 56 | if getattr(v, 'update', None): 57 | v.update(v) 58 | 59 | def AddMenuItem(menu, item, need_sep=False): 60 | block = getattr(item, 'menu_block', None) 61 | 62 | if block: 63 | if not menu.isEmpty(): 64 | menu.addSeparator() 65 | for i in public.all(block): 66 | AddMenuItem(menu, i) 67 | return getattr(item, 'menu_sep', False) 68 | 69 | if need_sep: 70 | menu.addSeparator() 71 | 72 | sep = getattr(item, 'menu_sep', False) 73 | part = getattr(item, 'menu_part', None) 74 | if part: 75 | for i in public.all(part): 76 | AddMenuItem(menu, i) 77 | return sep 78 | 79 | content = getattr(item, 'menu_content', None) 80 | 81 | if content: 82 | submenu = Menu(menu) 83 | 84 | init = getattr(item, 'Init', None) 85 | if init: 86 | init(submenu) 87 | 88 | make = getattr(item, 'Make', None) 89 | if make: 90 | submenu.make = make 91 | 92 | InitAction(item, submenu.menuAction()) 93 | menu.addMenu(submenu) 94 | MakeMenu(submenu, content) 95 | return sep 96 | 97 | action = QAction(menu) 98 | InitAction(item, action) 99 | menu.addAction(action) 100 | 101 | return sep 102 | 103 | 104 | def InitAction(item, action): 105 | label = getattr(item, 'vis_label', item.__name__) 106 | action.setText(label) 107 | 108 | shortcut = getattr(item, 'menu_shortcut', None) 109 | if shortcut: 110 | action.setShortcut(shortcut) 111 | 112 | checkable = getattr(item, 'menu_check', False) 113 | 114 | help = getattr(item, 'vis_help', '') 115 | action.setStatusTip(help) 116 | 117 | do = getattr(item, 'Do', None) 118 | update = getattr(item, 'Update', None) 119 | 120 | if do: 121 | if checkable: 122 | action.setCheckable(True) 123 | action.triggered[bool].connect(do) 124 | else: 125 | action.triggered.connect(do) 126 | 127 | if update: 128 | action.update = update 129 | 130 | action.setIconVisibleInMenu(False) 131 | 132 | return action 133 | 134 | def MakeActions(path, parent): 135 | actions = [] 136 | for i in public.all(path): 137 | action = QAction(parent) 138 | InitAction(i, action) 139 | actions.append(action) 140 | 141 | return actions 142 | 143 | def MakeMenu(menu, path): 144 | need_sep = False 145 | for i in public.all(path): 146 | need_sep = AddMenuItem(menu, i, need_sep) 147 | return menu 148 | 149 | def AssignMenuBar(owner, path): 150 | bar = owner.menuBar() 151 | if bar: 152 | bar.clear() 153 | else: 154 | bar = QMenuBar() 155 | 156 | list = public.all(path) 157 | list = sorted(list, cmp=lambda x,y: getattr(x, 'position', -1) - getattr(y, 'position', -1) ) 158 | 159 | for m in list: 160 | content = getattr(m, 'menu_content') 161 | menu_items = public.all(content) 162 | if public.all(content): 163 | label = getattr(m, 'vis_label', m.__name__) 164 | menu = Menu(bar) 165 | init = getattr(m, 'Init', None) 166 | if init: 167 | init(menu) 168 | menu.setTitle(label) 169 | bar.addMenu(menu) 170 | MakeMenu(menu, content) 171 | 172 | owner.setMenuBar(bar) 173 | 174 | def MakeTool(owner, toolbar, item): 175 | 176 | label = getattr(item, 'vis_label', item.__name__) 177 | icon = appdata.resources.GetIcon(getattr(item, 'vis_icon', 'error')) 178 | 179 | sep = getattr(item, 'tool_sep', False) 180 | 181 | if sep: 182 | toolbar.addSeparator() 183 | 184 | action = QAction(icon, label, toolbar) 185 | checkable = getattr(item, 'menu_check', False) 186 | do = getattr(item, 'Do', None) 187 | update = getattr(item, 'Update', None) 188 | if do: 189 | if checkable: 190 | action.setCheckable(True) 191 | action.triggered[bool].connect(do) 192 | else: 193 | action.triggered.connect(do) 194 | 195 | if update: 196 | action.update = update 197 | 198 | toolbar.addAction(action) 199 | 200 | def MakeToolBar(owner, path, title): 201 | tb = ToolBar(title, owner) 202 | for m in public.all(path): 203 | MakeTool(owner, tb, m) 204 | return tb 205 | -------------------------------------------------------------------------------- /editor_qt/framework/python_console.py: -------------------------------------------------------------------------------- 1 | """ 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | """ 18 | 19 | 20 | 21 | 22 | import framework.console 23 | from iso15926.tools.environment import EnvironmentContext 24 | from collections import deque 25 | import sys 26 | import pprint 27 | import framework.console 28 | from PySide.QtCore import * 29 | from PySide.QtGui import * 30 | 31 | class PseudoFileIn: 32 | 33 | def __init__(self, readline, readlines=None): 34 | if callable(readline): 35 | self.readline = readline 36 | else: 37 | raise ValueError, 'readline must be callable' 38 | if callable(readlines): 39 | self.readlines = readlines 40 | 41 | def readline(self): 42 | pass 43 | 44 | def write(self, s): 45 | pass 46 | 47 | def writelines(self, l): 48 | map(self.write, l) 49 | 50 | def flush(self): 51 | pass 52 | 53 | def isatty(self): 54 | return 1 55 | 56 | class PythonConsole(framework.console.Console): 57 | vis_label = tm.main.python_console 58 | 59 | TYPE_STRING = 0 60 | TYPE_FILE = 1 61 | 62 | def __init__(self, parent): 63 | framework.console.Console.__init__(self, parent, self.ExecutePythonString, self.ExecutePythonFile) 64 | log.setoutput(self.AddText) 65 | self.context = EnvironmentContext() 66 | self.reader = PseudoFileIn(self.readline, self.readlines) 67 | self.reader.input = '' 68 | self.reader.isreading = False 69 | sys.stdin = self.reader 70 | self.queue = deque() 71 | self.running = False 72 | 73 | def readline(self): 74 | input = '' 75 | reader = self.reader 76 | reader.isreading = True 77 | try: 78 | while not reader.input: 79 | QCoreApplication.processEvents() 80 | input = reader.input 81 | finally: 82 | reader.input = '' 83 | reader.isreading = False 84 | input = str(input) # In case of Unicode. 85 | return input 86 | 87 | def readlines(self): 88 | """Replacement for stdin.readlines().""" 89 | lines = [] 90 | while lines[-1:] != ['\n']: 91 | lines.append(self.readline()) 92 | return lines 93 | 94 | def Run(self, type, param): 95 | 96 | self.queue.append((type, param)) 97 | 98 | if self.running: 99 | return 100 | 101 | self.running = True 102 | try: 103 | while self.queue: 104 | type, param = self.queue.pop() 105 | 106 | self.context.Update() 107 | 108 | if type == self.TYPE_FILE: 109 | self.context.ExecutePythonFile(param) 110 | 111 | elif type == self.TYPE_STRING: 112 | if self.context.GetEnvironment(): 113 | appdata.environment_manager.latest_console_input = param 114 | 115 | res = self.context.ExecutePythonString(param) 116 | if res is not None: 117 | pprint.pprint(res) 118 | finally: 119 | self.running = False 120 | 121 | def ExecutePythonFile(self, filename): 122 | self.Run(self.TYPE_FILE, filename) 123 | 124 | def ExecutePythonString(self, text): 125 | if self.reader.isreading: 126 | self.reader.input = text 127 | else: 128 | self.Run(self.TYPE_STRING, text) 129 | 130 | 131 | -------------------------------------------------------------------------------- /editor_qt/framework/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | """ 18 | 19 | 20 | 21 | 22 | from PySide.QtCore import * 23 | from PySide.QtGui import * 24 | import framework.appconfig 25 | import os 26 | import framework.dialogs 27 | import sys 28 | from framework.util import FileBrowseButton 29 | import site 30 | 31 | class Settings_PathsPage(QWidget): 32 | 33 | msg_part4 = tm.main.settings_part4 34 | msg_pcardl = tm.main.settings_pcardl 35 | msg_p7tpl = tm.main.settings_p7tpl 36 | 37 | def __init__(self, parent): 38 | QWidget.__init__(self, parent) 39 | 40 | box = QGroupBox(tm.main.py_search_paths, self) 41 | self.pypath = QPlainTextEdit(box) 42 | self.pypath.setPlainText(os.pathsep.join(appconfig.get('sys.path', []))) 43 | 44 | layout = QVBoxLayout(self) 45 | layout.addWidget(box) 46 | 47 | box_layout = QVBoxLayout(box) 48 | box_layout.addWidget(self.pypath) 49 | 50 | box = QGroupBox(tm.main.settings_common_file_paths, self) 51 | 52 | self.part4_path = FileBrowseButton(box, appconfig.get('cfg://part4', '')) 53 | self.pcardl_path = FileBrowseButton(box, appconfig.get('cfg://pca_rdl', '')) 54 | self.p7tpl_path = FileBrowseButton(box, appconfig.get('cfg://p7tpl', '')) 55 | 56 | grid = QGridLayout(box) 57 | grid.addWidget(QLabel(self.msg_part4, self), 0, 0) 58 | grid.addWidget(self.part4_path, 0, 1) 59 | grid.addWidget(QLabel(self.msg_pcardl, self), 1, 0) 60 | grid.addWidget(self.pcardl_path, 1, 1) 61 | grid.addWidget(QLabel(self.msg_p7tpl, self), 2, 0) 62 | grid.addWidget(self.p7tpl_path, 2, 1) 63 | 64 | layout.addWidget(box) 65 | 66 | def Apply(self): 67 | newpaths = self.pypath.toPlainText().split(os.pathsep) 68 | sys.path = appdata.path 69 | for v in newpaths: 70 | site.addsitedir(v.encode(sys.getfilesystemencoding())) 71 | appconfig['sys.path'] = newpaths 72 | appconfig['cfg://part4'] = str(self.part4_path.GetPath()) 73 | appconfig['cfg://pca_rdl'] = str(self.pcardl_path.GetPath()) 74 | appconfig['cfg://p7tpl'] = str(self.p7tpl_path.GetPath()) 75 | 76 | appconfig.SaveSettings() 77 | 78 | return False 79 | 80 | class Settings_GeneralPage(QWidget): 81 | 82 | 83 | def __init__(self, parent): 84 | QWidget.__init__(self, parent) 85 | 86 | box = QGroupBox(tm.main.settings_enabled_extensions, self) 87 | 88 | extensions_dict = appconfig.get('extensions', {}) 89 | 90 | self.extensions = QListWidget(self) 91 | 92 | for k, v in extensions_dict.iteritems(): 93 | item = QListWidgetItem(k, self.extensions) 94 | 95 | if v: 96 | item.setCheckState(Qt.Checked) 97 | else: 98 | item.setCheckState(Qt.Unchecked) 99 | 100 | self.extensions.addItem(item) 101 | 102 | layout = QVBoxLayout(self) 103 | 104 | layout.addWidget(box) 105 | layout_box = QVBoxLayout(box) 106 | layout_box.addWidget(self.extensions) 107 | 108 | self.languages = QComboBox(self) 109 | current_lang = appconfig.get('language', 'en') 110 | for code, lang in tm._get_languages(): 111 | self.languages.addItem(QIcon(), lang) 112 | if code == current_lang: 113 | self.languages.setCurrentIndex(self.languages.count()-1) 114 | 115 | grid = QGridLayout() 116 | grid.addWidget(QLabel(tm.main.language, self), 0, 0) 117 | grid.addWidget(self.languages, 0, 1) 118 | 119 | layout.addLayout(grid) 120 | 121 | def Apply(self): 122 | extensions_dict = appconfig.get('extensions', {}) 123 | changed = False 124 | 125 | for i in xrange(self.extensions.count()): 126 | item = self.extensions.item(i) 127 | name = item.text() 128 | checked = item.checkState() == Qt.Checked 129 | if extensions_dict[name] != checked: 130 | changed = True 131 | extensions_dict[name] = checked 132 | 133 | if tm._get_languages()[self.languages.currentIndex()][0] != appconfig.get('language', 'en'): 134 | appconfig['language'] = tm._get_languages()[self.languages.currentIndex()][0] 135 | changed = True 136 | 137 | appconfig.SaveSettings() 138 | return changed 139 | 140 | class SettingsDialog(QDialog): 141 | 142 | vis_label = tm.main.settings 143 | msg_restart_required = tm.main.settings_restart_required 144 | 145 | def __init__(self): 146 | QDialog.__init__(self, appdata.topwindow, Qt.WindowSystemMenuHint | Qt.WindowTitleHint) 147 | self.setWindowTitle(self.vis_label) 148 | 149 | notebook = QTabWidget(self) 150 | 151 | layout = QVBoxLayout(self) 152 | layout.addWidget(notebook) 153 | 154 | self.btn_ok = QPushButton(tm.main.ok, self) 155 | self.btn_ok.setDefault(True) 156 | self.btn_cancel = QPushButton(tm.main.cancel, self) 157 | self.btn_ok.clicked.connect(self.accept) 158 | self.btn_cancel.clicked.connect(self.reject) 159 | 160 | layout_btn = QHBoxLayout() 161 | layout_btn.addStretch(1) 162 | layout_btn.addWidget(self.btn_ok) 163 | layout_btn.addWidget(self.btn_cancel) 164 | layout.addLayout(layout_btn) 165 | 166 | notebook.addTab(Settings_GeneralPage(notebook), tm.main.general) 167 | notebook.addTab(Settings_PathsPage(notebook), tm.main.paths) 168 | 169 | if self.exec_()==QDialog.Accepted: 170 | restart_needed = False 171 | for i in xrange(notebook.count()): 172 | if notebook.widget(i).Apply(): 173 | restart_needed = True 174 | if restart_needed: 175 | framework.dialogs.Notify(self.msg_restart_required) 176 | 177 | class PatternsSelection(QDialog): 178 | vis_label = tm.main.settings 179 | 180 | def __init__(self): 181 | QDialog.__init__(self, appdata.topwindow, Qt.WindowSystemMenuHint | Qt.WindowTitleHint) 182 | self.setWindowTitle(self.vis_label) 183 | -------------------------------------------------------------------------------- /editor_qt/framework/startpage.py: -------------------------------------------------------------------------------- 1 | """ 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | """ 18 | 19 | 20 | 21 | from PySide.QtCore import * 22 | from PySide.QtGui import * 23 | import os 24 | import sys 25 | from framework.docinfo import GetDocSource, OpenDoc, NameWithPrefix 26 | from framework.view import View 27 | 28 | class StartPage(View): 29 | vis_label = tm.main.startpage 30 | 31 | def __init__(self, parent): 32 | View.__init__(self, parent) 33 | 34 | self.SetTitle(self.vis_label) 35 | frame = QFrame(self) 36 | 37 | img = appdata.resources_dir + '/images/grid.png' 38 | frame.setStyleSheet('background-image: url({0})'.format(img)) 39 | self.text = QTextBrowser(frame) 40 | self.text.setStyleSheet('border: 0;') 41 | self.text.anchorClicked.connect(self.OnLinkClicked) 42 | self.text.highlighted[str].connect(self.OnLinkHighlighted) 43 | self.text.setOpenLinks(False) 44 | self.text.contextMenuEvent = lambda evt: evt.accept() 45 | layout = QHBoxLayout(frame) 46 | layout.addWidget(self.text) 47 | layout.setContentsMargins(0,0,0,0) 48 | self.setWidget(frame) 49 | self.Refresh() 50 | 51 | def Refresh(self): 52 | self.recent_projects_list = appconfig.setdefault('recent_projects', []) 53 | recent_projects = str() 54 | for idx in xrange(len(self.recent_projects_list)-1, -1, -1): 55 | projname, ext = os.path.splitext(os.path.basename(self.recent_projects_list[idx])) 56 | recent_projects += '{2}
'.format(idx, self.recent_projects_list[idx], projname) 57 | 58 | self.recent_sources_list = appconfig.setdefault('recent_sources', []) 59 | recent_sources = str() 60 | for idx in xrange(len(self.recent_sources_list)-1, -1, -1): 61 | v = self.recent_sources_list[idx] 62 | recent_sources += '{2}
'.format(idx, GetDocSource(v), NameWithPrefix(v)) 63 | 64 | self.text.setHtml(''' 65 | 66 | 67 |

.15926 Editor

68 |

{0}

69 |
70 | {1} 71 |

{2}

72 |
73 | {3} 74 | 75 | 76 | '''.format(tm.main.startpage_recent_projects, recent_projects, tm.main.startpage_recent_sources, recent_sources)) 77 | 78 | def OnLinkClicked(self, url): 79 | params = url.toString().split('|') 80 | if params[0] == 'project': 81 | appdata.project.OpenProjectFile(self.recent_projects_list[int(params[1])]) 82 | elif params[0] == 'source': 83 | doc = OpenDoc(self.recent_sources_list[int(params[1])]) 84 | if doc: 85 | appdata.project.AddDocument(doc) 86 | 87 | def OnLinkHighlighted(self, url): 88 | if url: 89 | self.setToolTip('{0}'.format(url.split('|')[-1])) 90 | else: 91 | self.setToolTip('') 92 | -------------------------------------------------------------------------------- /editor_qt/framework/view.py: -------------------------------------------------------------------------------- 1 | """ 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | """ 18 | 19 | 20 | 21 | 22 | from PySide.QtCore import * 23 | from PySide.QtGui import * 24 | 25 | 26 | class TitleBar(QFrame): 27 | def __init__(self, parent): 28 | QFrame.__init__(self, parent) 29 | self.SetActive(False) 30 | self.title = QLabel(tm.main.title, self) 31 | self.title.setSizePolicy(QSizePolicy.Ignored, QSizePolicy.Fixed) 32 | 33 | self.btn = QToolButton(self) 34 | self.btn.setIconSize(QSize(10,10)) 35 | self.btn.setIcon(appdata.app.style().standardIcon(QStyle.SP_TitleBarNormalButton)) 36 | self.btn.setText(tm.main.close) 37 | self.btn.setDefaultAction 38 | self.btn.clicked.connect(lambda: parent.setFloating(True)) 39 | self.btn.setAutoRaise(True) 40 | 41 | btn2 = QToolButton(self) 42 | btn2.setIconSize(QSize(10,10)) 43 | btn2.setIcon(appdata.app.style().standardIcon(QStyle.SP_TitleBarCloseButton)) 44 | btn2.setText(tm.main.close) 45 | btn2.clicked.connect(parent.close) 46 | btn2.setAutoRaise(True) 47 | 48 | layout = QHBoxLayout(self) 49 | layout.addSpacing(5) 50 | layout.addWidget(self.title) 51 | layout.addWidget(self.btn) 52 | layout.addWidget(btn2) 53 | layout.setContentsMargins(0,0,0,0) 54 | 55 | def SetActive(self, active): 56 | if active: 57 | self.setStyleSheet('QLabel{color: white;} TitleBar {background: qlineargradient( x1:0 y1:0, x2:1 y2:0, stop:0 MidnightBlue, stop:1 LightBlue);}') 58 | else: 59 | self.setStyleSheet('QLabel{color: black;} TitleBar {background: qlineargradient( x1:0 y1:0, x2:1 y2:0, stop:0 gray , stop:1 white);}') 60 | 61 | class View(QDockWidget): 62 | """Base class for view. 63 | 64 | Attributes: 65 | document: Document associated with this view. 66 | """ 67 | document = None 68 | vis_icon = 'blank_ico' 69 | def __init__(self, parent): 70 | QDockWidget.__init__(self, parent) 71 | self.setWindowTitle(tm.main.empty) 72 | self._dragged = False 73 | self.installEventFilter(self) 74 | self.setTitleBarWidget(TitleBar(self)) 75 | self.topLevelChanged.connect(self.OnDockState) 76 | self.visibilityChanged.connect(self.OnVisibilityChanged) 77 | self.viewnode = None 78 | self.seeable = False 79 | #elf.focusPolicy(Qt.ClickFocus) 80 | 81 | def changeEvent(self, evt): 82 | if evt.type() == QEvent.ActivationChange: 83 | if not self.isActiveWindow(): 84 | self.setFocus() 85 | QDockWidget.changeEvent(self, evt) 86 | 87 | def IsSeeable(self): 88 | return self.seeable 89 | 90 | def OnDockState(self, undock): 91 | if undock: 92 | self.titleBarWidget().btn.hide() 93 | else: 94 | self.titleBarWidget().btn.show() 95 | 96 | def focusNextPrevChild(self, next): 97 | if not self._dragged: 98 | return QDockWidget.focusNextPrevChild(self, next) 99 | return True 100 | 101 | def OnVisibilityChanged(self, visible): 102 | self.seeable = visible 103 | if visible: 104 | if appdata.active_view != self and appdata.active_view and appdata.active_view._dragged: 105 | return 106 | self.SetActive() 107 | 108 | def SetTitle(self, title): 109 | self.titleBarWidget().title.setText(title) 110 | self.setWindowTitle(title) 111 | 112 | def AddChild(self, obj): 113 | if obj and obj.isWidgetType(): 114 | obj.installEventFilter(self) 115 | 116 | for v in obj.children(): 117 | self.AddChild(v) 118 | 119 | def RemoveChild(self, obj): 120 | if obj and obj.isWidgetType(): 121 | obj.removeEventFilter(self) 122 | 123 | for v in obj.children(): 124 | self.RemoveChild(v) 125 | 126 | def eventFilter(self, obj, evt): 127 | if evt.type() == QEvent.ChildAdded: 128 | self.AddChild(evt.child()) 129 | elif evt.type() == QEvent.ChildRemoved: 130 | self.RemoveChild(evt.child()) 131 | elif evt.type() == QEvent.MouseButtonPress: 132 | if obj == self.titleBarWidget() and evt.button() == Qt.LeftButton: 133 | self._dragged = True 134 | self.SetActive() 135 | elif evt.type() == QEvent.MouseButtonRelease: 136 | self._dragged = False 137 | elif evt.type() == QEvent.FocusIn: 138 | self.SetActive(False) #child already focused 139 | return QDockWidget.eventFilter(self, obj, evt) 140 | 141 | def SetActive(self, focus = True): 142 | if self.viewnode: 143 | self.viewnode.Select() 144 | if self.viewnode.doc: 145 | appdata.active_document = self.viewnode.doc 146 | else: 147 | appdata.active_document = None 148 | 149 | if appdata.active_view == self: 150 | return 151 | 152 | if appdata.active_view != None: 153 | appdata.active_view.titleBarWidget().SetActive(False) 154 | if self.isFloating(): 155 | appdata.topwindow.setFocus(Qt.OtherFocusReason) 156 | 157 | if focus: 158 | self.setFocus(Qt.OtherFocusReason) 159 | 160 | self.titleBarWidget().SetActive(True) 161 | appdata.active_view = self 162 | 163 | def Highlight(self): 164 | pass 165 | 166 | def closeEvent(self, evt): 167 | evt.accept() 168 | if appdata.active_view == self: 169 | appdata.active_view = None 170 | for v in appdata.topwindow.workarea.findChildren(View): 171 | if v != self and v.IsSeeable(): 172 | v.SetActive(True) 173 | break 174 | 175 | def GetIcon(self): 176 | return self.vis_icon 177 | 178 | def FindViewMethod(self, methodname): 179 | pass 180 | 181 | def GetTitle(): 182 | """Returns label for view""" 183 | return "" 184 | 185 | def OnDestroy(self): 186 | pass 187 | -------------------------------------------------------------------------------- /editor_qt/graphlib.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/graphlib.pyd -------------------------------------------------------------------------------- /editor_qt/iso15926/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | """ 18 | 19 | 20 | from iso15926.graph.graph_document import GraphDocument 21 | from iso15926.patterns.patterns_document import PatternsDocument 22 | from iso15926.tools.environment import EnvironmentContext 23 | from iso15926.io.sparql import SparqlConnection -------------------------------------------------------------------------------- /editor_qt/iso15926/common/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | """ 18 | 19 | 20 | -------------------------------------------------------------------------------- /editor_qt/iso15926/common/testing.py: -------------------------------------------------------------------------------- 1 | """ 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | """ 18 | 19 | 20 | 21 | 22 | from iso15926.tools.environment import EnvironmentContext 23 | from PySide.QtCore import * 24 | from PySide.QtGui import * 25 | import os 26 | from framework.dialogs import Choice 27 | 28 | class TestWindow(QDialog): 29 | vis_label = tm.main.tests_title 30 | tests_dir = 'tests' 31 | 32 | def __init__(self): 33 | QDialog.__init__(self, appdata.topwindow, Qt.WindowSystemMenuHint | Qt.WindowTitleHint) 34 | self.setWindowTitle(self.vis_label) 35 | 36 | layout = QVBoxLayout(self) 37 | box = QGroupBox(tm.main.tests_field, self) 38 | 39 | self.tests_list = QListWidget(box) 40 | boxlayout = QHBoxLayout(box) 41 | boxlayout.addWidget(self.tests_list) 42 | layout.addWidget(box) 43 | 44 | for n in os.listdir(self.tests_dir): 45 | if n.startswith(".") or not n.endswith('.py'): 46 | continue 47 | 48 | sp = os.path.splitext(n) 49 | item = QListWidgetItem(sp[0], self.tests_list) 50 | item.setCheckState(Qt.Unchecked) 51 | 52 | 53 | self.btn_prepare = QPushButton(tm.main.prepare, self) 54 | self.btn_prepare.setToolTip(tm.main.prepare_selected_tests) 55 | self.btn_prepare.clicked.connect(self.OnPrepare) 56 | 57 | self.btn_run = QPushButton(tm.main.run, self) 58 | self.btn_run.setToolTip(tm.main.run_selected_tests) 59 | self.btn_run.clicked.connect(self.OnRun) 60 | 61 | 62 | self.btn_sel_all = QPushButton(tm.main.select_all, self) 63 | self.btn_sel_all.clicked.connect(self.SelectAll) 64 | 65 | self.btn_unsel_all = QPushButton(tm.main.unselect_all, self) 66 | self.btn_unsel_all.clicked.connect(self.UnselectAll) 67 | 68 | self.btn_cancel = QPushButton(tm.main.cancel, self) 69 | self.btn_cancel.clicked.connect(self.reject) 70 | 71 | btnlayout = QHBoxLayout() 72 | btnlayout.addWidget(self.btn_sel_all) 73 | btnlayout.addWidget(self.btn_unsel_all) 74 | btnlayout.addStretch() 75 | btnlayout.addWidget(self.btn_prepare) 76 | btnlayout.addWidget(self.btn_run) 77 | btnlayout.addWidget(self.btn_cancel) 78 | layout.addLayout(btnlayout) 79 | 80 | box = QGroupBox(tm.main.tests_result_field, self) 81 | self.report = QPlainTextEdit(self) 82 | boxlayout = QHBoxLayout(box) 83 | boxlayout.addWidget(self.report) 84 | layout.addWidget(box) 85 | self.exec_() 86 | 87 | def SelectAll(self): 88 | self.tests_list.SetChecked([x for x in xrange(self.tests_list.Count)]) 89 | 90 | def UnselectAll(self): 91 | self.tests_list.SetChecked([]) 92 | 93 | def OnPrepare(self): 94 | if Choice(tm.main.tests_prepare_warning): 95 | for k in self.tests_list.CheckedStrings: 96 | self.report.AppendText(tm.main.tests_preparing.format(k)) 97 | locals = {'mode': 'prepare'} 98 | ec = EnvironmentContext(None, locals) 99 | ec.ExecutePythonFile(os.path.join(self.tests_dir, k + '.py')) 100 | self.report.AppendText(tm.main.tests_preparing_done) 101 | 102 | def OnRun(self): 103 | all_passed = True 104 | self.report.appendPlainText(tm.main.tests_running) 105 | count = 0 106 | passed = 0 107 | 108 | for i in xrange(self.tests_list.count()): 109 | item = self.tests_list.item(i) 110 | name = item.text() 111 | if not item.checkState() == Qt.Checked: 112 | continue 113 | 114 | count += 1 115 | locals = {'mode': 'run', 'passed': False} 116 | ec = EnvironmentContext(None, locals) 117 | 118 | ec.ExecutePythonFile(os.path.join(self.tests_dir, name + '.py')) 119 | 120 | if locals['passed']: 121 | passed += 1 122 | self.report.appendPlainText(tm.main.test_passed.format(name)) 123 | else: 124 | self.report.appendPlainText(tm.main.test_failed.format(name)) 125 | 126 | self.report.appendPlainText(tm.main.tests_result) 127 | self.report.appendPlainText(tm.main.tests_result_info.format(passed, count)) 128 | 129 | 130 | if os.path.exists(TestWindow.tests_dir): 131 | @public('workbench.menu.help') 132 | class xTestMenu: 133 | vis_label = tm.main.menu_tests 134 | @classmethod 135 | def Do(cls): 136 | TestWindow() 137 | -------------------------------------------------------------------------------- /editor_qt/iso15926/graph/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | """ 18 | 19 | 20 | -------------------------------------------------------------------------------- /editor_qt/iso15926/io/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | """ 18 | 19 | 20 | -------------------------------------------------------------------------------- /editor_qt/iso15926/io/rdf_base.py: -------------------------------------------------------------------------------- 1 | """ 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | """ 18 | 19 | 20 | 21 | 22 | from graphlib import * 23 | 24 | import copy_reg, copy, pickle 25 | 26 | def ObjectTripleCreator(s, p, v): 27 | return ObjectTriple.of(s, p, v) 28 | 29 | def LiteralTripleCreator(s, p, v): 30 | return LiteralTriple.of(s, p, v) 31 | 32 | def DatatypeQuadCreator(s, p, v, d): 33 | return DatatypeQuad.of(s, p, v, d) 34 | 35 | def LangQuadCreator(s, p, v, d): 36 | return LangQuad.of(s, p, v, d) 37 | 38 | def pickle_ObjectTriple(triple): 39 | return ObjectTripleCreator, (triple.s,triple.p,triple.v) 40 | 41 | def pickle_LiteralTriple(triple): 42 | return LiteralTripleCreator, (triple.s,triple.p,triple.v) 43 | 44 | def pickle_DatatypeQuad(triple): 45 | return DatatypeQuadCreator, (triple.s,triple.p,triple.v,triple.d) 46 | 47 | def pickle_LangQuad(triple): 48 | return LangQuadCreator, (triple.s,triple.p,triple.v,triple.d) 49 | 50 | copy_reg.pickle(ObjectTriple, pickle_ObjectTriple) 51 | copy_reg.pickle(LiteralTriple, pickle_LiteralTriple) 52 | copy_reg.pickle(DatatypeQuad, pickle_DatatypeQuad) 53 | copy_reg.pickle(LangQuad, pickle_LangQuad) 54 | -------------------------------------------------------------------------------- /editor_qt/iso15926/io/trig_writer.py: -------------------------------------------------------------------------------- 1 | """ 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | """ 18 | 19 | 20 | 21 | 22 | import re 23 | from iso15926.io.rdf_base import expand_uri, compact_uri 24 | import iso15926.kb as kb 25 | import gzip 26 | from graphlib import bnode_prefix 27 | 28 | re_qn = re.compile(r'qn(\d+)') 29 | 30 | def escape(str): 31 | if "\n" in str: 32 | encoded = str.replace('\\', '\\\\') 33 | if '"""' in str: 34 | encoded = encoded.replace('"""', '\\"\\"\\"') 35 | if encoded[-1] == '"' and encoded[-2] != '\\': 36 | encoded = encoded[:-1] + '\\' + '"' 37 | 38 | return '"""%s"""' % encoded.replace('\r', '\\r') 39 | else: 40 | return '"%s"' % str.replace( 41 | '\n', '\\n').replace( 42 | '\\', '\\\\').replace( 43 | '"', '\\"').replace( 44 | '\r', '\\r') 45 | 46 | def split_uri(uri): 47 | p = uri.rfind('#') 48 | if p==-1: 49 | p = uri.rfind('/') 50 | if p==-1: 51 | return ('', uri) 52 | return (uri[:p+1], uri[p+1:]) 53 | 54 | class TrigWriter(object): 55 | 56 | def SaveGraphToFile(self, graph, fname, ttl=False, use_gzip = False): 57 | self.ttl = ttl 58 | if use_gzip: 59 | with gzip.open(fname, 'wb') as f: 60 | self.write = f.write 61 | self.write_graph(graph) 62 | else: 63 | with open(fname, 'wb') as f: 64 | self.write = f.write 65 | self.write_graph(graph) 66 | 67 | self.write = None 68 | public.collect_garbage() 69 | 70 | def write_graph(self, graph): 71 | 72 | graphs = {} 73 | 74 | graphs[''] = graph 75 | graphs.update(graph.ng) 76 | 77 | bases = set() 78 | self.nslist = {} 79 | self.nsset = set() 80 | 81 | for k, v in graphs.iteritems(): 82 | bases.add(v.basens) 83 | self.nslist.update(v.nslist) 84 | self.nsset |= v.grGetUsedNamespaces() 85 | 86 | self.basens = None 87 | bases = list(bases) 88 | if len(bases) == 1 and bases[0]: 89 | self.basens = bases.pop() 90 | self.nslist['basens'] = self.basens 91 | 92 | names = set() 93 | uris = set() 94 | 95 | uris.add(self.basens) 96 | for name, uri in self.nslist.iteritems(): 97 | names.add(name) 98 | uris.add(uri) 99 | 100 | unkns = [] 101 | for name in names: 102 | if re_qn.match(name): 103 | unkns.append(int(name[2:])) 104 | if unkns: 105 | unk = max(unkns)+1 106 | else: 107 | unk = 1 108 | 109 | for uri in self.nsset: 110 | if uri not in uris and uri != '' and uri != '_#': 111 | found = False 112 | for k, v in kb.all_known_namespaces: 113 | if v == uri and k not in names: 114 | self.nslist[k] = uri 115 | found = True 116 | break 117 | if not found: 118 | self.nslist['qn{0}'.format(unk)] = uri 119 | unk += 1 120 | 121 | self.ns_compact_name = {} 122 | for name, uri in self.nslist.iteritems(): 123 | self.ns_compact_name[uri] = name 124 | self.write('@prefix {0}: <{1}>.\n'.format(name, uri)) 125 | 126 | self.write('\n') 127 | 128 | for k, v in graphs.iteritems(): 129 | if k: 130 | if not self.ttl: 131 | self.write('<{0}> {{\n'.format(k)) 132 | self.process_graph(v) 133 | if not self.ttl: 134 | self.write('}\n') 135 | elif len(v.ks): 136 | if not self.ttl: 137 | self.write('{\n') 138 | self.process_graph(v) 139 | if not self.ttl: 140 | self.write('}\n') 141 | 142 | def to_ref(self, uri): 143 | ns, name = split_uri(uri) 144 | 145 | if uri.startswith(bnode_prefix): 146 | return '_:'+name 147 | 148 | ns = self.ns_compact_name.get(ns, None) 149 | if ns is None: 150 | return '<{0}>'.format(name) 151 | 152 | return '{0}:{1}'.format(ns, name) 153 | 154 | def resource(self, property, value): 155 | self.write('{0} {1}'.format(self.to_ref(property), self.to_ref(value))) 156 | 157 | def nontyped(self, property, value): 158 | self.write('{0} {1}'.format(self.to_ref(property), escape(value))) 159 | 160 | def langtyped(self, property, value, lang): 161 | self.write('{0} {1}@{2}'.format(self.to_ref(property), escape(value), escape(lang))) 162 | 163 | def datatyped(self, property, value, datatype): 164 | self.write('{0} {1}^^{2}'.format(self.to_ref(property), escape(value), self.to_ref(datatype))) 165 | 166 | def rdflist(self, property, lst): 167 | self.write('{0} ({1})'.format(self.to_ref(property), '\n'.join([self.to_ref(v) for v in lst]))) 168 | 169 | def write_entity(self, g, ent, triples): 170 | if not triples: 171 | return 172 | 173 | self.write(self.to_ref(ent)) 174 | self.write('\n') 175 | 176 | blank_nodes = set() 177 | 178 | l = list(triples) 179 | l.sort() 180 | first = True 181 | for t in l: 182 | if not first: 183 | self.write(';\n') 184 | first = False 185 | p = t.p 186 | if t.has_literal: 187 | if t.has_lang: 188 | self.langtyped(p, t.l, t.lang) 189 | elif t.has_datatype: 190 | self.datatyped(p, t.l, t.datatype) 191 | else: 192 | self.nontyped(p, t.l) 193 | else: 194 | o = t.o 195 | if g.grIs_rdflist(o): 196 | self.rdflist(p, g.grGet_rdflist(o)) 197 | else: 198 | self.resource(p, o) 199 | if o.startswith('_#'): 200 | blank_nodes.add(o) 201 | self.write('.\n') 202 | 203 | for v in blank_nodes: 204 | self.write_entity(g, v, g.ks.get(compact_uri(v), ())) 205 | 206 | def process_graph(self, g): 207 | total = len(g.ks) 208 | count = 0 209 | kl = g.ks.keys() 210 | kl.sort() 211 | for ent in kl: 212 | eent = expand_uri(ent) 213 | if eent.startswith('_#') and g.ko.get(ent) is not None: 214 | continue 215 | self.write_entity(g, eent, g.ks[ent]) 216 | count += 1 217 | if count % 1000 == 0: 218 | st = getattr(g, 'AsyncChangeState', None) 219 | if st: 220 | # graph is Document 221 | g.AsyncChangeState(g.state_saving, 100*count/total) 222 | 223 | 224 | -------------------------------------------------------------------------------- /editor_qt/iso15926/kb/other_defs.py: -------------------------------------------------------------------------------- 1 | """ 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | """ 18 | 19 | 20 | 21 | 22 | ns_pcardl_rdf = 'http://posccaesar.org/rdl/' 23 | ns_pcardl_sparql = 'http://posccaesar.org/rdl/' 24 | annlist_pcardl = [ 25 | 'hasIdPCA', 'hasDesignation', 'hasDesignationAltern', 'hasDesignationAbbrev', 26 | 'hasDefinition', 'hasDefinitionAdapted', 'hasStatus', 'hasCreationDate', 27 | 'hasCreator', 'hasDeleted', 'hasSubmitter', 'hasSubmitterOrg', 'hasRegistrar', 28 | 'hasRegistrarAuth', 'hasStewardship', 'hasStewardshipContact', 'hasNote', 29 | 'hasNoteAdmin', 'hasNoteExplanatory', 'hasNoteExample', 'hasNoteChange', 30 | 'hasNoteIssue', 'defaultRdsId', 31 | ] 32 | 33 | pca_rdf_designation = ns_pcardl_rdf + 'hasDesignation' 34 | pca_rdf_designation = ns_pcardl_rdf + 'hasDesignation' 35 | pca_rdf_definition = ns_pcardl_rdf + 'hasDefinition' 36 | 37 | pca_sparql_designation = ns_pcardl_sparql + 'hasDesignation' 38 | pca_sparql_definition = ns_pcardl_sparql + 'hasDefinition' 39 | 40 | labels_pca_rdf = [pca_rdf_designation, pca_rdf_definition] 41 | labels_pca_sparql = [pca_sparql_designation, pca_sparql_definition] 42 | labels_pca = labels_pca_rdf + labels_pca_sparql 43 | 44 | ns_rdswip = 'http://rdl.rdlfacade.org/data#' 45 | 46 | annlist_meta = [ 47 | 'annUniqueName', 'annTextDefinition', 'annSource', 'annNotes', 48 | 'annAdministrativeNote', 'annExplanatoryComment', 'annChangeDescription', 49 | 'annRule', 'annAccessCode', 'annURI', 'annUniqueNumber', 'annSynonym', 50 | 'annCreationDate', 'annEffectiveDate', 'annLastChangeDate', 'annRegistrationStatus', 51 | 'annStewardshipContact', 'annStewardshipOrganization', 'annSubmissionContact', 52 | 'annSubmittingOrganization', 'annUnresolvedIssues', 'annSymbol', 'annOperator', 53 | 'annFirstOperand', 'annSecondOperand', 'annFactor_Prefix', 'annExponent' 54 | ] 55 | 56 | 57 | ns_old_part4 = 'http://rds.posccaesar.org/2009/10/OWL/ISO-15926-4_2007#' 58 | annlist_old_part4 = ['spreadsheet'] 59 | 60 | ns_old_part6 = 'http://rds.posccaesar.org/2008/02/OWL/ISO-15926-6_2008_Draft#' 61 | annlist_old_part6 = ['designation', 'definition', 'source', 'notes'] 62 | 63 | 64 | ns_til = 'http://techinvestlab.ru/meta#' 65 | annlist_til = ['label_ru', 'label_en'] 66 | -------------------------------------------------------------------------------- /editor_qt/iso15926/kb/syntax_defs.py: -------------------------------------------------------------------------------- 1 | """ 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | """ 18 | 19 | 20 | 21 | from _ordereddict import ordereddict 22 | 23 | ns_xsd = "http://www.w3.org/2001/XMLSchema#" 24 | ns_rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#" 25 | ns_rdfs = "http://www.w3.org/2000/01/rdf-schema#" 26 | ns_owl = "http://www.w3.org/2002/07/owl#" 27 | ns_owllist = "http://www.co-ode.org/ontologies/list.owl#" 28 | ns_meta = 'http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/metadata#' 29 | ns_dc = 'http://purl.org/dc/elements/1.1/' 30 | ns_p7tm = 'http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/p7tm#' 31 | ns_skos = 'http://www.w3.org/2004/02/skos/core#' 32 | 33 | syntax_namespaces = [ 34 | ("xsd", ns_xsd), 35 | ("rdf", ns_rdf), 36 | ("rdfs", ns_rdfs), 37 | ("owl", ns_owl), 38 | ("owllist", ns_owllist) 39 | ] 40 | 41 | syntax_meta_namespaces = syntax_namespaces + [ 42 | ("meta", ns_meta) 43 | ] 44 | 45 | syntax_ns2uri = {} 46 | syntax_uri2ns = {} 47 | 48 | annlist_rdfs = ['label', 'comment'] 49 | rdf_type = ns_rdf+'type' 50 | rdfs_label = ns_rdfs+'label' 51 | skos_label = ns_skos+'prefLabel' 52 | rdfs_comment = ns_rdfs+'comment' 53 | rdfs_subclassof = ns_rdfs+'subClassOf' 54 | labels_rdfs = [rdfs_label] 55 | 56 | typelist_xsd = [ 57 | 'string', 'normalizedString', 'token', 'base64Binary', 'hexBinary', 'integer', 58 | 'positiveInteger', 'negativeInteger', 'nonNegativeInteger', 'nonPositiveInteger', 59 | 'long', 'unsignedLong', 'int', 'unsignedInt', 'short', 'unsignedShort', 'byte', 60 | 'unsignedByte', 'decimal', 'float', 'double', 'boolean', 'duration', 'dateTime', 61 | 'date', 'time', 'gYear', 'gYearMonth', 'gMonth', 'gMonthDay', 'gDay', 'Name', 'QName', 62 | 'NCName', 'anyURI', 'language' 63 | ] 64 | 65 | meta_unique = ns_meta + 'annUniqueName' 66 | labels_meta = [meta_unique] 67 | 68 | def _init(): 69 | for t in syntax_namespaces: 70 | syntax_ns2uri[t[0]] = t[1] 71 | syntax_uri2ns[t[1]] = t[0] 72 | _init() 73 | -------------------------------------------------------------------------------- /editor_qt/iso15926/patterns/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | """ 18 | 19 | 20 | -------------------------------------------------------------------------------- /editor_qt/iso15926/tools/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | """ 18 | 19 | 20 | -------------------------------------------------------------------------------- /editor_qt/lib/README.txt: -------------------------------------------------------------------------------- 1 | Extensions dependencies and other packages placed here. -------------------------------------------------------------------------------- /editor_qt/lib/pyodbc.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/lib/pyodbc.pyd -------------------------------------------------------------------------------- /editor_qt/patterns/patterns_mmttpl.patt: -------------------------------------------------------------------------------- 1 | {"UrClass": {"options": [{"parts": [{"urclass": "hasUrClass", "self": "entity1", "type": "mmttpl.ClassifiedIdentificationOfClass", "temp_class": "hasIdentified"}]}], "name": "UrClass", "signature": {"urclass": {"inverse_title": "has UrClass", "description": ""}, "temp_class": {"inverse_title": "is UrClass of", "description": ""}}}, "Specialization": {"options": [{"parts": [{"self": "entity1", "type": "mmttpl.SpecializationOfClass", "superclass": "hasSuperclass", "subclass": "hasUrClass"}]}], "name": "Specialization", "signature": {"superclass": {"inverse_title": "is subclass of", "description": ""}, "subclass": {"inverse_title": "is superclass of", "description": ""}}}, "Connection": {"options": [{"parts": [{"side2": "hasUrClassOfSide2", "self": "entity1", "type": "mmttpl.ClassifiedClassOfDirectConnectionDefinition", "side1": "hasUrClassOfSide1"}], "name": "mmttplDirectConnection"}, {"parts": [{"side2": "hasUrClassOfSide2", "self": "entity1", "type": "mmttpl.ClassifiedClassOfIndirectConnectionDefinition", "side1": "hasUrClassOfSide1"}]}], "name": "Connection", "signature": {"usage": {"inverse_title": "used in connection", "description": ""}, "connection": {"inverse_title": "connected via", "description": ""}, "side2": {"inverse_title": "is connected to", "description": ""}, "side1": {"inverse_title": "is connected to", "description": ""}}}, "Identification": {"options": [{"parts": [{"self": "entity1", "identifier": "valIdentifier", "type": "mmttpl.ClassifiedIdentificationOfClass", "identified": "hasUrClass"}]}, {"parts": [{"self": "entity1", "identifier": "valIdentifier", "type": "mmttpl.ClassifiedIdentificationOfIndividual", "identified": "hasIdentified"}]}], "name": "Identification", "signature": {"identifier": {"inverse_title": "is identified by", "description": ""}, "identified": {"inverse_title": "is identifier of", "description": ""}}}, "PropertyOfIndividual": {"options": [{"parts": [{"scale": "hasPropertyScale", "posessor": "hasPossessor", "self": "entity1", "value": "valPropertyValue", "property_type": "hasIndirectPropertyType", "type": "mmttpl.IndividualHasIndirectPropertyWithValue"}], "name": "IndividualHasIndirectPropertyWithValue"}, {"parts": [{"posessor_URI": "hasPossessor", "property_type_URI": "hasIndirectPropertyType", "self": "entity1", "scale_URI": "hasPropertyScale", "value": "valPropertyValue", "type": "mmttpl.IndividualHasIndirectPropertyWithValue"}, {"posessor_URI": "identified", "type": "patterns.Identification", "posessor": "identifier"}, {"property_type_URI": "identified", "property_type": "identifier", "type": "patterns.Identification.Label"}, {"scale_URI": "identified", "scale": "identifier", "type": "patterns.Identification.Label"}], "name": "FullNames_IndividualHasIndirectPropertyWithValue"}], "name": "PropertyOfIndividual", "signature": {"upper": {"inverse_title": "has upper bound", "description": ""}, "lower": {"inverse_title": "has lower bound", "description": ""}, "scale": {"inverse_title": "on scale", "description": ""}, "posessor": {"inverse_title": "is a property of", "description": ""}, "value": {"inverse_title": "has value", "description": ""}, "property": {"inverse_title": "has property", "description": ""}, "range": {"inverse_title": "has", "description": ""}, "property_type": {"inverse_title": "of type", "description": ""}}}, "Composition": {"options": [{"parts": [{"whole": "hasUrClassOfWhole", "self": "entity1", "part": "hasUrClassOfPart", "type": "mmttpl.ClassOfAssemblyDefinition"}]}, {"parts": [{"whole": "hasUrClassOfWhole", "self": "entity1", "part": "hasUrClassOfPart", "type": "mmttpl.ClassOfArrangementDefinition"}]}, {"parts": [{"whole": "hasUrClassOfWhole", "self": "entity1", "part": "hasUrClassOfPart", "type": "mmttpl.ClassOfFeatureWholePartDefinition"}]}, {"parts": [{"whole": "hasWhole", "self": "entity1", "part": "hasPart", "type": "mmttpl.AssemblyOfAIndividual"}]}], "name": "Composition", "signature": {"temporalpart": {"inverse_title": "has temporal parts", "description": ""}, "temporalwhole": {"inverse_title": "is temporal part of", "description": ""}, "part": {"inverse_title": "has parts", "description": ""}, "whole": {"inverse_title": "is part of", "description": ""}}}} -------------------------------------------------------------------------------- /editor_qt/patterns/patterns_part2.patt: -------------------------------------------------------------------------------- 1 | {"Definition": {"options": [{"parts": [{"defined": "hasRepresented", "definition": "hasPattern", "self": "entity1", "type": "part2.ClassOfDefinition"}]}, {"parts": [{"defined": "hasRepresented", "definition": "hasSign", "self": "entity1", "type": "part2.Definition"}]}], "name": "Definition", "signature": {"defined": {"inverse_title": "is definition of", "description": ""}, "definition": {"inverse_title": "is defined by", "description": ""}}}, "PropertyOfClass": {"options": [{"parts": [{"range": "hasPropertySpace", "type": "part2.ClassOfIndirectProperty", "self": "variable1", "posessor": "hasClassOfPossessor"}, {"variable1": "hasSubclass", "self": "entity1", "property": "hasSuperclass", "type": "part2.Specialization"}], "name": "PropertRangeRestrictionOfClassTemplateAxiom"}, {"parts": [{"range": "hasPropertySpace", "type": "part2.ClassOfIndirectProperty", "self": "property", "posessor": "hasClassOfPossessor"}], "name": "PropertRangeRestrictionOfClassSimple"}], "name": "PropertyOfClass", "signature": {"upper": {"inverse_title": "has upper bound", "description": ""}, "lower": {"inverse_title": "has lower bound", "description": ""}, "scale": {"inverse_title": "on scale", "description": ""}, "posessor": {"inverse_title": "is a property of", "description": ""}, "range": {"inverse_title": "has", "description": ""}, "property": {"inverse_title": "has property", "description": ""}, "property type": {"inverse_title": "of type", "description": ""}}}, "Specialization": {"options": [{"parts": [{"self": "entity1", "type": "part2.SpecializationByRole", "superclass": "hasSuperclass", "subclass": "hasSubclass"}]}, {"parts": [{"self": "entity1", "type": "part2.SpecializationByDomain", "superclass": "hasSuperclass", "subclass": "hasSubclass"}]}, {"parts": [{"self": "entity1", "type": "part2.SpecializationOfIndividualDimensionFromProperty", "superclass": "hasSuperclass", "subclass": "hasSubclass"}]}, {"parts": [{"self": "entity1", "type": "part2.Specialization", "superclass": "hasSuperclass", "subclass": "hasSubclass"}], "name": "SpecTemplAxiom"}], "name": "Specialization", "signature": {"superclass": {"inverse_title": "is subclass of", "description": ""}, "subclass": {"inverse_title": "is superclass of", "description": ""}}}, "Classification": {"options": [{"parts": [{"classofmember": "hasClassOfClassified", "classofclassifier": "hasClassOfClassifier", "self": "entity1", "type": "part2.ClassOfClassification"}]}, {"parts": [{"self": "entity1", "classified": "hasClassified", "type": "part2.Classification", "classifier": "hasClassifier"}], "name": "BaseClassificationTemplAxiom"}], "name": "Classification", "signature": {"classofmember": {"inverse_title": "is class of classifier", "description": ""}, "classofclassifier": {"inverse_title": "is class of member", "description": ""}, "classified": {"inverse_title": "is classifier of", "description": ""}, "classifier": {"inverse_title": "is classified by", "description": ""}}}, "Connection": {"options": [{"parts": [{"side2": "hasSide2", "self": "entity1", "type": "part2.ConnectionOfIndividual.any", "side1": "hasSide1"}]}, {"parts": [{"side2": "hasClassOfSide2", "self": "entity1", "type": "part2.ClassOfConnectionOfIndividual.any", "side1": "hasClassOfSide1"}]}, {"parts": [{"usage": "hasClassOfUsage", "connection": "hasClassOfConnection", "type": "part2.ClassOfIndividualUsedInConnection", "self": "entity1"}]}, {"parts": [{"usage": "hasUsage", "connection": "hasConnection", "type": "part2.IndividualUsedInConnection", "self": "entity1"}]}], "name": "Connection", "signature": {"usage": {"inverse_title": "used in connection", "description": ""}, "connection": {"inverse_title": "connected via", "description": ""}, "side2": {"inverse_title": "is connected to", "description": ""}, "side1": {"inverse_title": "is connected to", "description": ""}}}, "Identification": {"options": [{"parts": [{"self": "entity1", "identifier": "hasSign", "type": "part2.Identification", "identified": "hasRepresented"}]}, {"parts": [{"self": "entity1", "identifier": "hasPattern", "type": "part2.ClassOfIdentification", "identified": "hasRepresented"}]}], "name": "Identification", "signature": {"identifier": {"inverse_title": "is identified by", "description": ""}, "identified": {"inverse_title": "is identifier of", "description": ""}}}, "Representation": {"options": [{"parts": [{"represented": "hasRepresented", "self": "entity1", "type": "part2.ClassOfRepresentationOfThing", "representer": "hasPattern"}]}, {"parts": [{"represented": "hasRepresented", "self": "entity1", "type": "part2.RepresentationOfThing", "representer": "hasSign"}]}], "name": "Representation", "signature": {"represented": {"inverse_title": "is representation of", "description": ""}, "representer": {"inverse_title": "is represented by", "description": ""}}}, "Composition": {"options": [{"parts": [{"whole": "hasClassOfWhole", "self": "entity1", "part": "hasClassOfPart", "type": "part2.ClassOfCompositionOfIndividual"}]}, {"parts": [{"whole": "hasWhole", "self": "entity1", "part": "hasPart", "type": "part2.CompositionOfIndividual"}]}, {"parts": [{"whole": "hasClassOfWhole", "self": "entity1", "part": "hasClassOfPart", "type": "part2.ClassOfAssemblyOfIndividual"}]}, {"parts": [{"whole": "hasWhole", "self": "entity1", "part": "hasPart", "type": "part2.AssemblyOfIndividual"}]}, {"parts": [{"whole": "hasWhole", "self": "entity1", "part": "hasPart", "type": "part2.ArrangementOfIndividual"}]}, {"parts": [{"whole": "hasClassOfWhole", "self": "entity1", "part": "hasClassOfPart", "type": "part2.ClassOfArrangementOfIndividual"}]}, {"parts": [{"whole": "hasClassOfWhole", "self": "entity1", "part": "hasClassOfPart", "type": "part2.ClassOfFeatureWholePart"}]}, {"parts": [{"whole": "hasWhole", "self": "entity1", "part": "hasPart", "type": "part2.FeatureWholePart"}]}, {"parts": [{"whole": "hasClassOfClassOfWhole", "self": "entity1", "part": "hasClassOfClassOfPart", "type": "part2.ClassOfClassOfComposition"}]}, {"parts": [{"temporalpart": "hasPart", "temporalwhole": "hasWhole", "type": "part2.TemporalWholePart", "self": "entity1"}]}, {"parts": [{"temporalpart": "hasClassOfPart", "temporalwhole": "hasClassOfWhole", "type": "part2.ClassOfTemporalWholePart", "self": "entity1"}]}], "name": "Composition", "signature": {"temporalpart": {"inverse_title": "has temporal parts", "description": ""}, "temporalwhole": {"inverse_title": "is temporal part of", "description": ""}, "part": {"inverse_title": "has parts", "description": ""}, "whole": {"inverse_title": "is part of", "description": ""}}}, "Description": {"options": [{"parts": [{"described": "hasRepresented", "self": "entity1", "type": "part2.Description", "descriptor": "hasSign"}]}, {"parts": [{"described": "hasRepresented", "self": "entity1", "type": "part2.ClassOfDescription", "descriptor": "hasPattern"}]}], "name": "Description", "signature": {"descriptor": {"inverse_title": "is described by", "description": ""}, "described": {"inverse_title": "is descriptor of", "description": ""}}}} -------------------------------------------------------------------------------- /editor_qt/patterns/patterns_rdf.patt: -------------------------------------------------------------------------------- 1 | {"Definition": {"signature": {"defined": {"inverse_title": "is definition of", "description": ""}, "definition": {"inverse_title": "is defined by", "description": ""}}, "options": [{"parts": [{"definition": "http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/metadata#annTextDefinition", "self": "defined"}], "name": "annTextDefinition"}, {"parts": [{"definition": "http://posccaesar.org/rdl/hasDefinition", "self": "defined"}], "name": "hasDefinition"}], "name": "Definition"}, "Identification": {"signature": {"identifier": {"inverse_title": "is identified by", "description": ""}, "identified": {"inverse_title": "is identifier of", "description": ""}}, "options": [{"parts": [{"self": "identified", "identifier": "http://www.w3.org/2000/01/rdf-schema#label"}], "name": "Label"}, {"parts": [{"self": "identified", "identifier": "http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/metadata#annUniqueNumber"}], "name": "annUniqueNumber"}, {"parts": [{"self": "identified", "identifier": "http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/metadata#annUniqueName"}], "name": "annUniqueName"}, {"parts": [{"self": "identified", "identifier": "part2.hasContent"}], "name": "hasContent"}, {"parts": [{"self": "identified", "identifier": "http://posccaesar.org/rdl/hasDesignation"}], "name": "hasDesignation"}, {"parts": [{"self": "identified", "identifier": "http://www.w3.org/2004/02/skos/core#prefLabel"}], "name": "prefLabel"}, {"parts": [{"self": "identified", "identifier": "http://posccaesar.org/rdl/defaultRdsId"}], "name": "defaultRdsId"}, {"parts": [{"self": "identifier", "identified": "http://posccaesar.org/rdl/rdsWipEquivalent"}], "name": "rdsWipEquivalent"}], "name": "Identification"}, "Specialization": {"signature": {"superclass": {"inverse_title": "is subclass of", "description": ""}, "subclass": {"inverse_title": "is superclass of", "description": ""}}, "options": [{"parts": [{"self": "subclass", "superclass": "http://www.w3.org/2000/01/rdf-schema#subClassOf"}], "name": "SubClassProperty"}, {"parts": [{"self": "subclass", "superclass": "http://www.w3.org/2000/01/rdf-schema#subPropertyOf"}], "name": "SubPropertyProperty"}], "name": "Specialization"}, "Classification": {"signature": {"classofmember": {"inverse_title": "is class of classifier", "description": ""}, "classofclassifier": {"inverse_title": "is class of member", "description": ""}, "classified": {"inverse_title": "is classifier of", "description": ""}, "classifier": {"inverse_title": "is classified by", "description": ""}}, "options": [{"parts": [{"self": "classified", "classifier": "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"}], "name": "TypeProperty"}], "name": "Classification"}, "Description": {"signature": {"descriptor": {"inverse_title": "is described by", "description": ""}, "described": {"inverse_title": "is descriptor of", "description": ""}}, "options": [{"parts": [{"descriptor": "comment", "self": "described"}], "name": "comment"}], "name": "Description"}} -------------------------------------------------------------------------------- /editor_qt/resources/example.tm: -------------------------------------------------------------------------------- 1 | menu_example_menu "Example menu" 2 | saving_doc "Saving {0}..." 3 | menu_open_txt "Open text file..." 4 | open_txt_title "Open text file..." 5 | txt_view "Text view" -------------------------------------------------------------------------------- /editor_qt/resources/ext.tm: -------------------------------------------------------------------------------- 1 | menu_setup_catalog "Setup catalog dependencies..." 2 | menu_catalog "Import catalog..." 3 | menu_import_catalog "Import catalog data from JSON file..." 4 | setup_catalog_title "Setup catalog dependencies..." 5 | template_set_field "Template set:" 6 | rdl_field "RDL:" 7 | attr_inheritance "Process attribute inheritance" 8 | ns_for_new_field "Namespace for new entities:" 9 | menu_import_geom "Import templates from .xlsx table..." 10 | ok "OK" 11 | cancel "Cancel" 12 | import_geom_title "Setup .xlsx import..." 13 | uri_for_new_field "Generate human readable URIs for new entities:" 14 | select_xlsx "Select .xlsx file..." 15 | importing_doc "Importing {0}..." 16 | menu_import_iringtempl "Import IIP templates from .xlsx table..." 17 | menu_tablan "Import TabLan..." 18 | menu_setup_tablan "Setup TabLan dependencies..." 19 | menu_import_tablan "Import TabLan reference data from .xlsx table..." 20 | setup_tablan_title "Setup TabLan dependencies..." 21 | menu_import "&Import" 22 | patterns_from_excel "Build patterns from MS Excel" 23 | patterns_setup_import "Setup import" 24 | patterns_select_sheet "Select sheet" 25 | patterns_select_pattern "Select pattern" 26 | patterns_import "Import" 27 | patterns_close "Close" 28 | patterns_load_file "Load mapping" 29 | patterns_save_file "Save mapping" 30 | patterns_init "Initializing MS Excel" 31 | patterns_err_not_avail "MS Excel not available!" 32 | patterns_err_com "MS Excel communication error:\n{}\nPlease stop any editing in MS Excel before retry" 33 | patterns_load_mapping "Load mapping..." 34 | patterns_save_mapping "Save mapping..." 35 | patterns_err_load "Unable to load mapping data." 36 | patterns_err_save "Unable to save mapping data." 37 | patterns_wrk_importing "Importing..." 38 | patterns_state_indexing "Indexing columns..." 39 | patterns_state_labels "Creating label database..." 40 | patterns_state_proc "Processing rows..." 41 | patterns_state_update "Updating cell validation..." 42 | patterns_ready "Ready for import" 43 | patterns_stop "Stop" 44 | patterns_err_not_found "Pattern %s not found." 45 | roles "Roles" 46 | columns "Columns" 47 | menu_import_tip "Import patterns from TIP *.mdb file" 48 | tip_import_req_warning "Modules 'mmtpl' and 'iiptpl' are required to import. Please add required modules to the project and try again." 49 | patterns_invalid_column "Warning! Column {0} will be ignored, mapped pattern part has 'self' descriptor!" 50 | patterns_to_excel "Export patterns to MS Excel" 51 | patterns_state_query "Running pattern query..." 52 | patterns_export "Export" 53 | tip_import_patterns "Import patterns" 54 | patterns_setup_export "Setup report" 55 | tip_generate_generic "Discover generic patterns" 56 | patterns_full_export "Export all pattern components" 57 | 58 | -------------------------------------------------------------------------------- /editor_qt/resources/images/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/Thumbs.db -------------------------------------------------------------------------------- /editor_qt/resources/images/arrow_down_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/arrow_down_green.png -------------------------------------------------------------------------------- /editor_qt/resources/images/arrow_up_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/arrow_up_green.png -------------------------------------------------------------------------------- /editor_qt/resources/images/blank_ico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/blank_ico.png -------------------------------------------------------------------------------- /editor_qt/resources/images/check2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/check2.png -------------------------------------------------------------------------------- /editor_qt/resources/images/checks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/checks.png -------------------------------------------------------------------------------- /editor_qt/resources/images/console.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/console.png -------------------------------------------------------------------------------- /editor_qt/resources/images/copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/copy.png -------------------------------------------------------------------------------- /editor_qt/resources/images/cross_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/cross_gray.png -------------------------------------------------------------------------------- /editor_qt/resources/images/cross_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/cross_red.png -------------------------------------------------------------------------------- /editor_qt/resources/images/cube_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/cube_blue.png -------------------------------------------------------------------------------- /editor_qt/resources/images/cube_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/cube_green.png -------------------------------------------------------------------------------- /editor_qt/resources/images/cube_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/cube_yellow.png -------------------------------------------------------------------------------- /editor_qt/resources/images/cubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/cubes.png -------------------------------------------------------------------------------- /editor_qt/resources/images/cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/cut.png -------------------------------------------------------------------------------- /editor_qt/resources/images/data_find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/data_find.png -------------------------------------------------------------------------------- /editor_qt/resources/images/data_find_wip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/data_find_wip.png -------------------------------------------------------------------------------- /editor_qt/resources/images/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/delete.png -------------------------------------------------------------------------------- /editor_qt/resources/images/disk_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/disk_blue.png -------------------------------------------------------------------------------- /editor_qt/resources/images/disk_blue_ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/disk_blue_ok.png -------------------------------------------------------------------------------- /editor_qt/resources/images/disk_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/disk_green.png -------------------------------------------------------------------------------- /editor_qt/resources/images/disks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/disks.png -------------------------------------------------------------------------------- /editor_qt/resources/images/document_triangle_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/document_triangle_green.png -------------------------------------------------------------------------------- /editor_qt/resources/images/dot_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/dot_gray.png -------------------------------------------------------------------------------- /editor_qt/resources/images/dot_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/dot_red.png -------------------------------------------------------------------------------- /editor_qt/resources/images/element.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/element.png -------------------------------------------------------------------------------- /editor_qt/resources/images/element_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/element_add.png -------------------------------------------------------------------------------- /editor_qt/resources/images/element_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/element_delete.png -------------------------------------------------------------------------------- /editor_qt/resources/images/element_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/element_warning.png -------------------------------------------------------------------------------- /editor_qt/resources/images/elephant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/elephant.png -------------------------------------------------------------------------------- /editor_qt/resources/images/environment_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/environment_view.png -------------------------------------------------------------------------------- /editor_qt/resources/images/environment_view2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/environment_view2.png -------------------------------------------------------------------------------- /editor_qt/resources/images/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/error.png -------------------------------------------------------------------------------- /editor_qt/resources/images/error_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/error_small.png -------------------------------------------------------------------------------- /editor_qt/resources/images/exclamation-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/exclamation-red.png -------------------------------------------------------------------------------- /editor_qt/resources/images/find_tpl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/find_tpl.png -------------------------------------------------------------------------------- /editor_qt/resources/images/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/folder.png -------------------------------------------------------------------------------- /editor_qt/resources/images/gear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/gear.png -------------------------------------------------------------------------------- /editor_qt/resources/images/gears.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/gears.png -------------------------------------------------------------------------------- /editor_qt/resources/images/grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/grid.png -------------------------------------------------------------------------------- /editor_qt/resources/images/iso_annotation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/iso_annotation.png -------------------------------------------------------------------------------- /editor_qt/resources/images/iso_class.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/iso_class.png -------------------------------------------------------------------------------- /editor_qt/resources/images/iso_class_i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/iso_class_i.png -------------------------------------------------------------------------------- /editor_qt/resources/images/iso_classofclass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/iso_classofclass.png -------------------------------------------------------------------------------- /editor_qt/resources/images/iso_classofclass_i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/iso_classofclass_i.png -------------------------------------------------------------------------------- /editor_qt/resources/images/iso_co_classofrel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/iso_co_classofrel.png -------------------------------------------------------------------------------- /editor_qt/resources/images/iso_co_classofrel_i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/iso_co_classofrel_i.png -------------------------------------------------------------------------------- /editor_qt/resources/images/iso_co_rel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/iso_co_rel.png -------------------------------------------------------------------------------- /editor_qt/resources/images/iso_co_rel_i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/iso_co_rel_i.png -------------------------------------------------------------------------------- /editor_qt/resources/images/iso_group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/iso_group.png -------------------------------------------------------------------------------- /editor_qt/resources/images/iso_group_find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/iso_group_find.png -------------------------------------------------------------------------------- /editor_qt/resources/images/iso_individual.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/iso_individual.png -------------------------------------------------------------------------------- /editor_qt/resources/images/iso_individual_i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/iso_individual_i.png -------------------------------------------------------------------------------- /editor_qt/resources/images/iso_literal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/iso_literal.png -------------------------------------------------------------------------------- /editor_qt/resources/images/iso_rel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/iso_rel.png -------------------------------------------------------------------------------- /editor_qt/resources/images/iso_rel_i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/iso_rel_i.png -------------------------------------------------------------------------------- /editor_qt/resources/images/iso_role.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/iso_role.png -------------------------------------------------------------------------------- /editor_qt/resources/images/iso_spec_template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/iso_spec_template.png -------------------------------------------------------------------------------- /editor_qt/resources/images/iso_syntax.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/iso_syntax.png -------------------------------------------------------------------------------- /editor_qt/resources/images/iso_template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/iso_template.png -------------------------------------------------------------------------------- /editor_qt/resources/images/iso_template_c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/iso_template_c.png -------------------------------------------------------------------------------- /editor_qt/resources/images/iso_template_inst.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/iso_template_inst.png -------------------------------------------------------------------------------- /editor_qt/resources/images/iso_unknown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/iso_unknown.png -------------------------------------------------------------------------------- /editor_qt/resources/images/loading0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/loading0.png -------------------------------------------------------------------------------- /editor_qt/resources/images/loading1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/loading1.png -------------------------------------------------------------------------------- /editor_qt/resources/images/loading2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/loading2.png -------------------------------------------------------------------------------- /editor_qt/resources/images/media_play_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/media_play_green.png -------------------------------------------------------------------------------- /editor_qt/resources/images/more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/more.png -------------------------------------------------------------------------------- /editor_qt/resources/images/nav_down_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/nav_down_green.png -------------------------------------------------------------------------------- /editor_qt/resources/images/nav_up_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/nav_up_green.png -------------------------------------------------------------------------------- /editor_qt/resources/images/navigate_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/navigate_down.png -------------------------------------------------------------------------------- /editor_qt/resources/images/option_ico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/option_ico.png -------------------------------------------------------------------------------- /editor_qt/resources/images/paste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/paste.png -------------------------------------------------------------------------------- /editor_qt/resources/images/pattern_ico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/pattern_ico.png -------------------------------------------------------------------------------- /editor_qt/resources/images/patterns_doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/patterns_doc.png -------------------------------------------------------------------------------- /editor_qt/resources/images/pin-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/pin-small.png -------------------------------------------------------------------------------- /editor_qt/resources/images/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/plus.png -------------------------------------------------------------------------------- /editor_qt/resources/images/project_ico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/project_ico.png -------------------------------------------------------------------------------- /editor_qt/resources/images/rdf_ico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/rdf_ico.png -------------------------------------------------------------------------------- /editor_qt/resources/images/redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/redo.png -------------------------------------------------------------------------------- /editor_qt/resources/images/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/refresh.png -------------------------------------------------------------------------------- /editor_qt/resources/images/tpl_ico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/tpl_ico.png -------------------------------------------------------------------------------- /editor_qt/resources/images/undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/undo.png -------------------------------------------------------------------------------- /editor_qt/resources/images/view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/view.png -------------------------------------------------------------------------------- /editor_qt/resources/images/warning_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/warning_small.png -------------------------------------------------------------------------------- /editor_qt/resources/images/window_new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/images/window_new.png -------------------------------------------------------------------------------- /editor_qt/resources/locale/ru/LC_MESSAGES/dot15926_example.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/locale/ru/LC_MESSAGES/dot15926_example.mo -------------------------------------------------------------------------------- /editor_qt/resources/locale/ru/LC_MESSAGES/dot15926_example.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: \n" 4 | "POT-Creation-Date: \n" 5 | "PO-Revision-Date: \n" 6 | "Last-Translator: \n" 7 | "Language-Team: \n" 8 | "MIME-Version: 1.0\n" 9 | "Content-Type: text/plain; charset=UTF-8\n" 10 | "Content-Transfer-Encoding: 8bit\n" 11 | "Generated-By: dot15926\n" 12 | "X-Generator: Poedit 1.5.7\n" 13 | 14 | msgid "Text view" 15 | msgstr "Тексты" 16 | 17 | msgid "Example menu" 18 | msgstr "Меню примеров" 19 | 20 | msgid "Open text file..." 21 | msgstr "Открыть текстовый файл..." 22 | 23 | msgid "Saving {0}..." 24 | msgstr "Сохраняется {0}..." 25 | -------------------------------------------------------------------------------- /editor_qt/resources/locale/ru/LC_MESSAGES/dot15926_ext.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/locale/ru/LC_MESSAGES/dot15926_ext.mo -------------------------------------------------------------------------------- /editor_qt/resources/locale/ru/LC_MESSAGES/dot15926_ext.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: \n" 4 | "POT-Creation-Date: \n" 5 | "PO-Revision-Date: \n" 6 | "Last-Translator: \n" 7 | "Language-Team: \n" 8 | "MIME-Version: 1.0\n" 9 | "Content-Type: text/plain; charset=UTF-8\n" 10 | "Content-Transfer-Encoding: 8bit\n" 11 | "Generated-By: dot15926\n" 12 | "X-Generator: Poedit 1.5.7\n" 13 | 14 | msgid "Setup catalog dependencies..." 15 | msgstr "Настроить импорт каталога..." 16 | 17 | msgid "&Import" 18 | msgstr "Импорт" 19 | 20 | msgid "Select .xlsx file..." 21 | msgstr "Выбрать файл .xlsx..." 22 | 23 | msgid "Pattern %s not found." 24 | msgstr "Структура %s не найдена." 25 | 26 | msgid "Processing rows..." 27 | msgstr "Обработка строк..." 28 | 29 | msgid "Import" 30 | msgstr "Импорт" 31 | 32 | msgid "Columns" 33 | msgstr "Столбцы" 34 | 35 | msgid "Updating cell validation..." 36 | msgstr "Обновление проверки ячеек..." 37 | 38 | msgid "Save to file" 39 | msgstr "Сохранить в файл" 40 | 41 | msgid "Creating label database..." 42 | msgstr "Создание списков имён..." 43 | 44 | msgid "Stop" 45 | msgstr "Остановить" 46 | 47 | msgid "Import catalog data from JSON file..." 48 | msgstr "Импортировать данные каталога из файла JSON..." 49 | 50 | msgid "Setup import" 51 | msgstr "Настроить импорт" 52 | 53 | msgid "Ready for import" 54 | msgstr "Готовность к импорту" 55 | 56 | msgid "RDL:" 57 | msgstr "Справочные данные:" 58 | 59 | msgid "Cancel" 60 | msgstr "Отмена" 61 | 62 | msgid "Setup .xlsx import..." 63 | msgstr "Настроить импорт из .xlsx..." 64 | 65 | msgid "Unable to save mapping data." 66 | msgstr "Невозможно сохранить данные отображения." 67 | 68 | msgid "Load from file" 69 | msgstr "Загрузить из файла" 70 | 71 | msgid "Indexing columns..." 72 | msgstr "Индексирование колонок..." 73 | 74 | msgid "Build patterns from Excel" 75 | msgstr "Импорт структур из таблиц Excel" 76 | 77 | msgid "Setup TabLan dependencies..." 78 | msgstr "Настроить импорт TabLan..." 79 | 80 | msgid "Unable to load mapping data." 81 | msgstr "Невозможно загрузить данные отображения." 82 | 83 | msgid "Select sheet" 84 | msgstr "Выбрать лист" 85 | 86 | msgid "Roles" 87 | msgstr "Роли" 88 | 89 | msgid "" 90 | "Warning! Column {0} will be ignored, mapped pattern part has 'self' " 91 | "descriptor!" 92 | msgstr "" 93 | "Внимание! Колонка {0} не будет обработана, так как эта часть отображённой " 94 | "структуры описана через 'self'!" 95 | 96 | msgid "Import TabLan reference data from .xlsx table..." 97 | msgstr "Импортировать справочные данные TabLan из файла .xlsx..." 98 | 99 | msgid "Template set:" 100 | msgstr "Набор шаблонов:" 101 | 102 | msgid "Save mapping..." 103 | msgstr "Сохранить отображение..." 104 | 105 | msgid "Import IIP templates from .xlsx table..." 106 | msgstr "Импортировать шаблоны IIP из файла .xlsx..." 107 | 108 | msgid "Load mapping..." 109 | msgstr "Загрузить отображение..." 110 | 111 | msgid "Namespace for new entities:" 112 | msgstr "Пространство имён для новых элементов:" 113 | 114 | msgid "Initializing MS Excel" 115 | msgstr "Инициализация MS Excel" 116 | 117 | msgid "Generate human readable URIs for new entities:" 118 | msgstr "Создавать человекочитаемые URI" 119 | 120 | msgid "OK" 121 | msgstr "Да" 122 | 123 | msgid "Importing..." 124 | msgstr "Импортируется..." 125 | 126 | msgid "MS Excel not available!" 127 | msgstr "MS Excel недоступен!" 128 | 129 | msgid "Import templates from .xlsx table..." 130 | msgstr "Импортировать шаблоны из файла .xlsx..." 131 | 132 | msgid "Process attribute inheritance" 133 | msgstr "Добавлять унаследованные атрибуты" 134 | 135 | msgid "Select pattern" 136 | msgstr "Выбрать структуру" 137 | 138 | msgid "Close" 139 | msgstr "Закрыть" 140 | 141 | msgid "Importing {0}..." 142 | msgstr "Импортируется {0}..." 143 | -------------------------------------------------------------------------------- /editor_qt/resources/locale/ru/LC_MESSAGES/dot15926_main.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/editor_qt/resources/locale/ru/LC_MESSAGES/dot15926_main.mo -------------------------------------------------------------------------------- /graphlib/_ordereddict/lib/_ordereddict.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/graphlib/_ordereddict/lib/_ordereddict.lib -------------------------------------------------------------------------------- /graphlib/_ordereddict/lib/_ordereddict.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/graphlib/_ordereddict/lib/_ordereddict.pyd -------------------------------------------------------------------------------- /graphlib/_ordereddict/lib/_ordereddict_d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/graphlib/_ordereddict/lib/_ordereddict_d.lib -------------------------------------------------------------------------------- /graphlib/_ordereddict/lib/_ordereddict_d.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/graphlib/_ordereddict/lib/_ordereddict_d.pyd -------------------------------------------------------------------------------- /graphlib/base.h: -------------------------------------------------------------------------------- 1 | /* 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | */ 18 | 19 | 20 | #ifndef _BASE_H_ 21 | #define _BASE_H_ 22 | #define MAX_URI_LENGTH 2048 23 | 24 | extern const char * const bnode_prefix; 25 | extern const size_t bnode_prefix_len; 26 | 27 | char * compact_uri(const char* uri, char* out); 28 | char * expand_uri(const char* curi, char* out); 29 | char * curi_head(const char* curi, char* out); 30 | char * curi_tail(const char* curi, char* out); 31 | 32 | const char* compact_uri_str(const char *uri); 33 | const char* expand_uri_str(const char *curi); 34 | const char* new_bnodeid(); 35 | const char* bnodeid(const char *id); 36 | 37 | PyObject * py_new_bnodeid(); 38 | PyObject * py_bnodeid(PyObject *id); 39 | PyObject * py_compact_uri(PyObject *uri); 40 | PyObject * py_expand_uri(PyObject *uri); 41 | PyObject * py_curi_head(PyObject *curi); 42 | PyObject * py_curi_tail(PyObject *curi); 43 | 44 | #endif -------------------------------------------------------------------------------- /graphlib/graph.h: -------------------------------------------------------------------------------- 1 | /* 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | */ 18 | 19 | 20 | #ifndef _GRAPH_H_ 21 | #define _GRAPH_H_ 22 | 23 | enum ge_t { 24 | GE_TRIPLE_INSERT, 25 | GE_TRIPLE_DELETE, 26 | GE_TRIPLE_ADDED, 27 | GE_TRIPLE_REMOVED, 28 | GE_LOG, 29 | GE_PROGRESS, 30 | GE_MAX 31 | }; 32 | 33 | typedef struct { 34 | PyObject_HEAD 35 | PyObject *ks; 36 | //PyObject *kp; 37 | PyObject *ko; 38 | PyObject *kl; 39 | PyObject *nslist; 40 | PyObject *basens; 41 | PyObject *idi; 42 | PyObject *ng; 43 | PyObject *gt; 44 | struct { 45 | PyObject **arr; 46 | size_t len; 47 | } cb[GE_MAX]; 48 | } Graph; 49 | 50 | int Graph_insert_item(Graph *graph, PyObject *item); 51 | int Graph_delete_item(Graph *graph, PyObject *item); 52 | int Graph_has_item(Graph *graph, PyObject *item); 53 | PyObject * Graph_cache_pystring(Graph *graph, PyObject *string); 54 | PyObject * Graph_cache_string(Graph *graph, const char *string); 55 | 56 | int Graph_insert_object(Graph *graph, const char* s, const char* p, const char* o); 57 | int Graph_insert_literal(Graph *graph, const char* s, const char* p, const char* l); 58 | int Graph_insert_lang(Graph *graph, const char* s, const char* p, const char* l, const char* c); 59 | int Graph_insert_datatype(Graph *graph, const char* s, const char* p, const char* l, const char* c); 60 | int Graph_set_basens(Graph *graph, const char* ns); 61 | int Graph_add_ns(Graph *graph, const char* prefix, const char* uri); 62 | 63 | int init_graph_types(); 64 | int public_graph_types(PyObject *m); 65 | 66 | int Graph_call_cb(Graph *graph, int type, PyObject *data); 67 | 68 | #endif -------------------------------------------------------------------------------- /graphlib/graphitem.h: -------------------------------------------------------------------------------- 1 | /* 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | */ 18 | 19 | 20 | #ifndef _GRAPHITEM_H_ 21 | #define _GRAPHITEM_H_ 22 | 23 | typedef struct 24 | { 25 | PyTupleObject t; 26 | } GraphItem; 27 | 28 | extern PyTypeObject ObjectTripleType; 29 | extern PyTypeObject LiteralTripleType; 30 | extern PyTypeObject LangQuadType; 31 | extern PyTypeObject DatatypeQuadType; 32 | 33 | int init_graphitem_types(); 34 | int public_graphitem_types(PyObject *m); 35 | 36 | 37 | #endif -------------------------------------------------------------------------------- /graphlib/graphlib.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual C++ Express 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "graphlib", "graphlib.vcproj", "{F6AD43B5-550F-4241-A580-79C4B7410CA3}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {F6AD43B5-550F-4241-A580-79C4B7410CA3}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {F6AD43B5-550F-4241-A580-79C4B7410CA3}.Debug|Win32.Build.0 = Debug|Win32 14 | {F6AD43B5-550F-4241-A580-79C4B7410CA3}.Release|Win32.ActiveCfg = Release|Win32 15 | {F6AD43B5-550F-4241-A580-79C4B7410CA3}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /graphlib/graphlib.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 14 | 15 | 16 | 17 | 18 | 25 | 28 | 31 | 34 | 37 | 40 | 50 | 53 | 56 | 59 | 67 | 70 | 73 | 76 | 79 | 82 | 85 | 88 | 89 | 97 | 100 | 103 | 106 | 109 | 112 | 122 | 125 | 128 | 131 | 141 | 144 | 147 | 150 | 153 | 156 | 159 | 162 | 163 | 164 | 165 | 166 | 167 | 172 | 175 | 176 | 179 | 180 | 183 | 184 | 187 | 188 | 191 | 192 | 195 | 196 | 199 | 200 | 203 | 204 | 207 | 208 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | -------------------------------------------------------------------------------- /graphlib/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | */ 18 | 19 | 20 | #include "Python.h" 21 | #include "base.h" 22 | #include "graph.h" 23 | #include "graphitem.h" 24 | #include "rdf.h" 25 | 26 | static PyObject * 27 | read_rdf_file(PyObject *self, PyObject *args) 28 | { 29 | const char *fname; 30 | const char *syntax="rdfxml"; 31 | PyObject *graph; 32 | 33 | if (!PyArg_ParseTuple(args, "sO|s", &fname, &graph, &syntax)) 34 | { 35 | PyErr_SetString(PyExc_TypeError, 36 | "argument error"); 37 | return NULL; 38 | } 39 | 40 | if(_read_rdf_file(fname, (Graph*)graph, syntax) == -1) { 41 | PyErr_SetString(PyExc_Exception, 42 | "Loading RDF failed."); 43 | return NULL; 44 | } 45 | 46 | Py_RETURN_NONE; 47 | } 48 | 49 | static PyObject * 50 | read_rdf_string(PyObject *self, PyObject *args) 51 | { 52 | const char *data; 53 | size_t len; 54 | const char *syntax="rdfxml"; 55 | PyObject *graph; 56 | 57 | if (!PyArg_ParseTuple(args, "slO|s", &data, &len, &graph, &syntax)) 58 | { 59 | PyErr_SetString(PyExc_TypeError, 60 | "argument error"); 61 | return NULL; 62 | } 63 | 64 | if(_read_rdf_string(data, len, (Graph*)graph, syntax) == -1) { 65 | PyErr_SetString(PyExc_Exception, 66 | "Loading RDF failed."); 67 | return NULL; 68 | } 69 | 70 | Py_RETURN_NONE; 71 | } 72 | 73 | static PyObject * 74 | new_bnodeid_func(PyObject *self) 75 | { 76 | return py_new_bnodeid(); 77 | } 78 | 79 | static PyObject * 80 | bnodeid_func(PyObject *self, PyObject *args) 81 | { 82 | PyObject *str; 83 | 84 | if (!PyArg_ParseTuple(args, "S", &str)) 85 | { 86 | PyErr_SetString(PyExc_TypeError, 87 | "argument error"); 88 | return NULL; 89 | } 90 | 91 | return py_bnodeid(str); 92 | } 93 | 94 | static PyObject * 95 | compact_uri_func(PyObject *self, PyObject *args) 96 | { 97 | PyObject *str; 98 | 99 | if (!PyArg_ParseTuple(args, "S", &str)) 100 | { 101 | PyErr_SetString(PyExc_TypeError, 102 | "argument error"); 103 | return NULL; 104 | } 105 | 106 | return py_compact_uri(str); 107 | } 108 | 109 | static PyObject * 110 | expand_uri_func(PyObject *self, PyObject *args) 111 | { 112 | PyObject *str; 113 | 114 | if (!PyArg_ParseTuple(args, "S", &str)) 115 | { 116 | PyErr_SetString(PyExc_TypeError, 117 | "argument error"); 118 | return NULL; 119 | } 120 | 121 | return py_expand_uri(str); 122 | } 123 | 124 | static PyObject * 125 | curi_head_func(PyObject *self, PyObject *args) 126 | { 127 | PyObject *str; 128 | 129 | if (!PyArg_ParseTuple(args, "S", &str)) 130 | { 131 | PyErr_SetString(PyExc_TypeError, 132 | "argument error"); 133 | return NULL; 134 | } 135 | 136 | return py_curi_head(str); 137 | } 138 | 139 | static PyObject * 140 | curi_tail_func(PyObject *self, PyObject *args) 141 | { 142 | PyObject *str; 143 | 144 | if (!PyArg_ParseTuple(args, "S", &str)) 145 | { 146 | PyErr_SetString(PyExc_TypeError, 147 | "argument error"); 148 | return NULL; 149 | } 150 | 151 | return py_curi_tail(str); 152 | } 153 | 154 | static PyObject * 155 | rdf_parser_info(PyObject *self) 156 | { 157 | _rdf_parser_info(); 158 | Py_RETURN_NONE; 159 | } 160 | 161 | static PyMethodDef graphlib_functions[] = { 162 | { "new_bnodeid", (PyCFunction)new_bnodeid_func, METH_NOARGS, 163 | "" 164 | }, 165 | { "bnodeid", (PyCFunction)bnodeid_func, METH_VARARGS, 166 | "" 167 | }, 168 | { "compact_uri", compact_uri_func, METH_VARARGS, 169 | "" 170 | }, 171 | { "expand_uri", expand_uri_func, METH_VARARGS, 172 | "" 173 | }, 174 | { "curi_head", curi_head_func, METH_VARARGS, 175 | "" 176 | }, 177 | { "curi_tail", curi_tail_func, METH_VARARGS, 178 | "" 179 | }, 180 | { "read_rdf_file", read_rdf_file, METH_VARARGS, 181 | "" 182 | }, 183 | { "read_rdf_string", read_rdf_string, METH_VARARGS, 184 | "" 185 | }, 186 | { "rdf_parser_info", (PyCFunction)rdf_parser_info, METH_NOARGS, 187 | "" 188 | }, 189 | {NULL, NULL} /* sentinel */ 190 | }; 191 | 192 | PyMODINIT_FUNC 193 | initgraphlib() 194 | { 195 | PyObject *m; 196 | 197 | m = PyImport_ImportModule("_ordereddict"); 198 | Py_DECREF(m); 199 | 200 | init_graph_types(); 201 | init_graphitem_types(); 202 | 203 | m = Py_InitModule3("graphlib", 204 | graphlib_functions, 205 | "" 206 | // , NULL, PYTHON_API_VERSION 207 | ); 208 | if (m == NULL) 209 | return; 210 | 211 | 212 | if (PyModule_AddObject(m, "bnode_prefix", (PyObject *) PyString_FromString(bnode_prefix)) < 0) { 213 | return; 214 | } 215 | 216 | public_graph_types(m); 217 | public_graphitem_types(m); 218 | } 219 | -------------------------------------------------------------------------------- /graphlib/raptor2/lib/raptor2.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/graphlib/raptor2/lib/raptor2.lib -------------------------------------------------------------------------------- /graphlib/raptor2/lib/raptor2_d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/graphlib/raptor2/lib/raptor2_d.lib -------------------------------------------------------------------------------- /graphlib/rdf.h: -------------------------------------------------------------------------------- 1 | /* 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | */ 18 | 19 | 20 | #ifndef _RDFPARSER_H_ 21 | #define _RDFPARSER_H_ 22 | 23 | void _rdf_parser_info(); 24 | int _read_rdf_file(const char *filename, Graph *graph, const char* syntax); 25 | int _read_rdf_string(const char *str, size_t len, Graph *graph, const char* syntax); 26 | int _write_rdf_file(const char *filename, Graph *graph, const char *syntax); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /graphlib/rdfbase.c: -------------------------------------------------------------------------------- 1 | /* 2 | .15925 Editor 3 | Copyright 2014 TechInvestLab.ru dot15926@gmail.com 4 | 5 | .15925 Editor is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | .15925 Editor is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with .15925 Editor. 17 | */ 18 | 19 | 20 | #include "Python.h" 21 | #include "graph.h" 22 | #include "rdf.h" 23 | #include "raptor2/inc/raptor2.h" 24 | 25 | void _rdf_parser_info() 26 | { 27 | raptor_world *world = NULL; 28 | int i; 29 | world = raptor_new_world(); 30 | PySys_WriteStdout("Syntaxes:\n"); 31 | for (i = 0; 1; i++) { 32 | const raptor_syntax_description *sd; 33 | sd = raptor_world_get_parser_description(world, i); 34 | if (!sd) { 35 | break; 36 | } 37 | PySys_WriteStdout(" %-14s for %s\n", sd->names[0], sd->label); 38 | } 39 | raptor_free_world(world); 40 | } -------------------------------------------------------------------------------- /graphlib/zlib/lib/zdll.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/graphlib/zlib/lib/zdll.lib -------------------------------------------------------------------------------- /graphlib/zlib/lib/zlib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechInvestLab/dot15926/18c344f3706c1fef4d1b50dd1673eb0d4e2c031b/graphlib/zlib/lib/zlib.lib --------------------------------------------------------------------------------