From fa62e4cc7c127d4de44461a9a6cf5b31e364c4c0 Mon Sep 17 00:00:00 2001 From: laowantong Date: Thu, 28 Dec 2023 16:48:48 +0100 Subject: [PATCH 1/9] commit forgotten files --- mocodo/resources/relation_templates/latex-c.yaml | 4 ++++ mocodo/resources/relation_templates/latex-ce.yaml | 4 ++++ mocodo/resources/relation_templates/mssql.yaml | 6 +++--- test/zoo/alt/mld/alt_0_mld.tex | 6 +++--- test/zoo/cluster_NN1/mld/cluster_NN1_0_mld.tex | 6 +++--- test/zoo/complex/mld/complex_mld.tex | 2 +- test/zoo/drain/mld/drain_mld.tex | 2 +- test/zoo/empty_attrs/mld/empty_attrs_0_mld.tex | 2 +- test/zoo/inheritance/mld/inheritance_3_mld.tex | 6 +++--- test/zoo/inheritance/mld/inheritance_4_mld.tex | 6 +++--- test/zoo/inheritance/mld/inheritance_5_mld.tex | 6 +++--- test/zoo/ternary_unicity/mld/ternary_unicity_0_mld.tex | 6 +++--- test/zoo/triple_111/mld/triple_111_0_mld.tex | 4 ++-- test/zoo/triple_111/mld/triple_111_1_mld.tex | 4 ++-- test/zoo/triple_N11/mld/triple_N11_0_mld.tex | 4 ++-- test/zoo/triple_N11/mld/triple_N11_1_mld.tex | 4 ++-- test/zoo/triple_NN1/mld/triple_NN1_0_mld.tex | 2 +- test/zoo/triple_NN1/mld/triple_NN1_1_mld.tex | 2 +- test/zoo/triple_NNN/mld/triple_NNN_0_mld.tex | 2 +- test/zoo/triple_NNN/mld/triple_NNN_1_mld.tex | 2 +- 20 files changed, 44 insertions(+), 36 deletions(-) diff --git a/mocodo/resources/relation_templates/latex-c.yaml b/mocodo/resources/relation_templates/latex-c.yaml index 7de5e12c..6e672bdd 100644 --- a/mocodo/resources/relation_templates/latex-c.yaml +++ b/mocodo/resources/relation_templates/latex-c.yaml @@ -30,3 +30,7 @@ transform_relation: comment: 'Exponents' search: ' (.+?)' replace: '$^{\1}$' + - order: 1600 + comment: 'Escape underlines' + search: '_' + replace: '\_' diff --git a/mocodo/resources/relation_templates/latex-ce.yaml b/mocodo/resources/relation_templates/latex-ce.yaml index 3074f0ad..3180a532 100644 --- a/mocodo/resources/relation_templates/latex-ce.yaml +++ b/mocodo/resources/relation_templates/latex-ce.yaml @@ -52,3 +52,7 @@ transform_relational_schema: - order: 1500 search: '(( \\item .+\n)+)' replace: ' \\begin{itemize}\n\1 \\end{itemize}\n' + - order: 1600 + comment: 'Escape underlines' + search: '_' + replace: '\_' diff --git a/mocodo/resources/relation_templates/mssql.yaml b/mocodo/resources/relation_templates/mssql.yaml index f9026bd3..a1336384 100644 --- a/mocodo/resources/relation_templates/mssql.yaml +++ b/mocodo/resources/relation_templates/mssql.yaml @@ -10,15 +10,15 @@ fr_examples: explanation: 'avec _boilerplate_' parent: 'sql' stem_suffix: '_ddl_mssql' -transform_attribute: +transform_label: - order: 1100 comment: 'Protect reserved keywords' - search: '(?i)^(ACCESS|ACCESSIBLE|ALLOCATE|ANALYSE|ANALYZE|ARE|ARRAY|ASENSITIVE|ASSERTION|ASYMMETRIC|AT|AUDIT|AUTOINCREMENT|AVG|BEFORE|BIGINT|BINARY|BIT|BLOB|BOOLEAN|BOTH|CALL|CASCADED|CAST|CHANGE|CHAR|CHARACTER|CHARACTER_LENGTH|CLUSTER|COLLATION|COMMENT|COMPRESS|CONCAT|CONCURRENTLY|CONDITION|CONNECT|CONNECTION|CONSTRAINTS|CORRESPONDING|COUNT|CUBE|CUME_DIST|CURRENT_CATALOG|CURRENT_PATH|CURRENT_ROLE|CURRENT_SCHEMA|DATABASES|DATE|DAY|DAYS|DAY_HOUR|DAY_MICROSECOND|DAY_MINUTE|DAY_SECOND|DEC|DECIMAL|DEFERRABLE|DEFERRED|DEFINE|DEFINER|DELAYED|DENSE_RANK|DESCRIBE|DETERMINISTIC|DIAGNOSTICS|DISCONNECT|DISTINCTROW|DIV|DO|DUAL|EACH|ELSEIF|EMPTY|ENCLOSED|ENUM|ESCAPED|EXCEPTION|EXCLUDE|EXCLUSIVE|EXPLAIN|EXTRACT|FALSE|FILTER|FIRST|FIRST_VALUE|FLOAT|FLOAT4|FLOAT8|FOLLOWING|FORCE|FOUND|FREEZE|FULLTEXT|GENERATED|GET|GLOB|GLOBAL|GO|GROUPING|GROUPS|HASH|HIGH_PRIORITY|HOUR|HOURS|HOUR_MICROSECOND|HOUR_MINUTE|HOUR_SECOND|IDENTIFIED|IGNORE|ILIKE|IMMEDIATE|INCREMENT|INDEXED|INDICATOR|INFILE|INITIAL|INITIALLY|INOUT|INPUT|INSENSITIVE|INT|INT1|INT2|INT3|INT4|INT8|INTEGER|INTERVAL|INVOKER|IO_AFTER_GTIDS|IO_BEFORE_GTIDS|ISNULL|ISOLATION|ITERATE|JSON_ARRAYAGG|JSON_EXISTS|JSON_OBJECTAGG|JSON_TABLE|KEYS|LAG|LAST|LAST_VALUE|LATERAL|LEAD|LEADING|LEAVE|LEVEL|LIMIT|LINEAR|LINES|LOAD|LOCALTIME|LOCALTIMESTAMP|LOCK|LONG|LONGBLOB|LONGTEXT|LOOP|LOWER|LOW_PRIORITY|LTRIM|MASTER_BIND|MASTER_SSL_VERIFY_SERVER_CERT|MATCH|MAX|MAXEXTENTS|MAXVALUE|MEDIUMBLOB|MEDIUMINT|MEDIUMTEXT|MEMBER|MICROSECOND|MICROSECONDS|MIDDLEINT|MIN|MINUS|MINUTE|MINUTES|MINUTE_MICROSECOND|MINUTE_SECOND|MLSLABEL|MOD|MODE|MODIFIES|MODIFY|MONTH|MONTHS|NATURAL|NCHAR|NEW|NEXT|NO|NOAUDIT|NOCOMPRESS|NONE|NOTHING|NOTNULL|NOWAIT|NO_WRITE_TO_BINLOG|NTH_VALUE|NTILE|NULLS|NUMBER|NUMERIC|NVARCHAR|OFFLINE|OFFSET|ONLINE|ONLY|OPTIMIZE|OPTIMIZER_COSTS|OPTIONALLY|OUT|OUTFILE|OUTPUT|OVERLAPS|PAD|PARALLEL|PARTIAL|PARTITION|PCTFREE|PERCENTILE_CONT|PERCENTILE_DISC|PERCENT_RANK|PLACING|PORTION|POSITION|PRECEDING|PRECISION|PREPARE|PRESERVE|PRIOR|PRIVILEGES|PURGE|RAISE|RANGE|RANK|RAW|READS|READ_WRITE|REAL|RECURSIVE|REGEXP|RELATIVE|RELEASE|RENAME|REPEAT|REPLACE|REQUIRE|RESIGNAL|RESOURCE|RESPECT|RETURNING|RLIKE|ROLLUP|ROW|ROWID|ROWNUM|ROWS|ROW_NUMBER|RTRIM|SCHEMAS|SCROLL|SECOND|SECONDS|SECOND_MICROSECOND|SENSITIVE|SEPARATOR|SESSION|SHARE|SHOW|SIGNAL|SIMILAR|SIZE|SMALLINT|SOUNDS|SPACE|SPATIAL|SPECIFIC|SQL|SQLCODE|SQLERROR|SQLEXCEPTION|SQLID|SQLSTATE|SQLWARNING|SQL_BIG_RESULT|SQL_BUFFER_RESULT|SQL_CACHE|SQL_CALC_FOUND_ROWS|SQL_NO_CACHE|SQL_SMALL_RESULT|SSL|START|STARTING|STATS_AUTO_RECALC|STATS_PERSISTENT|STATS_SAMPLE_PAGES|STDDEV_POP|STDDEV_SAMP|STORED|STRAIGHT_JOIN|SUBSTRING|SUCCESSFUL|SUM|SYMMETRIC|SYNONYM|SYSDATE|SYSTEM|TEMPORARY|TERMINATED|TIMEZONE_HOUR|TIMEZONE_MINUTE|TINYBLOB|TINYINT|TINYTEXT|TRAILING|TRANSLATE|TRANSLATION|TREAT|TRIM|TRUE|UESCAPE|UID|UNBOUNDED|UNDO|UNKNOWN|UNLOCK|UNNEST|UNSIGNED|UPPER|USAGE|USING|UTC_DATE|UTC_TIME|UTC_TIMESTAMP|VALIDATE|VALUE|VARBINARY|VARCHAR|VARCHAR2|VARCHARACTER|VARIADIC|VAR_POP|VAR_SAMP|VERBOSE|VIRTUAL|WHENEVER|WINDOW|WITHIN|WITHOUT|WORK|WRITE|XML|XMLCAST|XMLEXISTS|XMLFOREST|XMLPARSE|XMLQUERY|XMLROOT|XMLSERIALIZE|XOR|YEAR|YEARS|YEAR_MONTH|ZEROFILL)$' + search: '(?i)^(ACCESS|ACCESSIBLE|ALLOCATE|ANALYSE|ANALYZE|ARE|ARRAY|ASENSITIVE|ASSERTION|ASYMMETRIC|AT|AUDIT|AUTOINCREMENT|AVG|BEFORE|BIGINT|BINARY|BIT|BLOB|BOOLEAN|BOTH|CALL|CASCADED|CAST|CHANGE|CHAR|CHARACTER|CHARACTER_LENGTH|CLUSTER|COLLATION|COMMENT|COMPRESS|CONCAT|CONCURRENTLY|CONDITION|CONNECT|CONNECTION|CONSTRAINTS|CORRESPONDING|COUNT|CUBE|CUME_DIST|CURRENT_CATALOG|CURRENT_PATH|CURRENT_ROLE|CURRENT_SCHEMA|DATABASES|DATE|DAY|DAYS|DAY_HOUR|DAY_MICROSECOND|DAY_MINUTE|DAY_SECOND|DEC|DECIMAL|DEFERRABLE|DEFERRED|DEFINE|DEFINER|DELAYED|DENSE_RANK|DESCRIBE|DETERMINISTIC|DIAGNOSTICS|DISCONNECT|DISTINCTROW|DIV|DO|DUAL|EACH|ELSEIF|EMPTY|ENCLOSED|ENUM|ESCAPED|EXCEPTION|EXCLUDE|EXCLUSIVE|EXPLAIN|EXTRACT|FALSE|FILTER|FIRST|FIRST_VALUE|FLOAT|FLOAT4|FLOAT8|FOLLOWING|FORCE|FOUND|FREEZE|FULLTEXT|GENERATED|GET|GLOB|GLOBAL|GO|GROUPING|GROUPS|HASH|HIGH_PRIORITY|HOUR|HOURS|HOUR_MICROSECOND|HOUR_MINUTE|HOUR_SECOND|IDENTIFIED|IGNORE|ILIKE|IMMEDIATE|INCREMENT|INDEXED|INDICATOR|INFILE|INITIAL|INITIALLY|INOUT|INPUT|INSENSITIVE|INT|INT1|INT2|INT3|INT4|INT8|INTEGER|INTEVAL|INVOKER|IO_AFTER_GTIDS|IO_BEFORE_GTIDS|ISNULL|ISOLATION|ITERATE|JSON_ARRAYAGG|JSON_EXISTS|JSON_OBJECTAGG|JSON_TABLE|KEYS|LAG|LAST|LAST_VALUE|LATERAL|LEAD|LEADING|LEAVE|LEVEL|LIMIT|LINEAR|LINES|LOAD|LOCALTIME|LOCALTIMESTAMP|LOCK|LONG|LONGBLOB|LONGTEXT|LOOP|LOWER|LOW_PRIORITY|LTRIM|MASTER_BIND|MASTER_SSL_VERIFY_SERVER_CERT|MATCH|MAX|MAXEXTENTS|MAXVALUE|MEDIUMBLOB|MEDIUMINT|MEDIUMTEXT|MEMBER|MICROSECOND|MICROSECONDS|MIDDLEINT|MIN|MINUS|MINUTE|MINUTES|MINUTE_MICROSECOND|MINUTE_SECOND|MLSLABEL|MOD|MODE|MODIFIES|MODIFY|MONTH|MONTHS|NATURAL|NCHAR|NEW|NEXT|NO|NOAUDIT|NOCOMPRESS|NONE|NOTHING|NOTNULL|NOWAIT|NO_WRITE_TO_BINLOG|NTH_VALUE|NTILE|NULLS|NUMBER|NUMERIC|NVARCHAR|OFFLINE|OFFSET|ONLINE|ONLY|OPTIMIZE|OPTIMIZER_COSTS|OPTIONALLY|OUT|OUTFILE|OUTPUT|OVERLAPS|PAD|PARTIAL|PARTITION|PCTFREE|PERCENTILE_CONT|PERCENTILE_DISC|PERCENT_RANK|PLACING|PORTION|POSITION|PRECEDING|PRECISION|PREPARE|PRESERVE|PRIOR|PRIVILEGES|PURGE|RAISE|RANGE|RANK|RAW|READS|READ_WRITE|REAL|RECURSIVE|REGEXP|RELATIVE|RELEASE|RENAME|REPEAT|REPLACE|REQUIRE|RESIGNAL|RESOURCE|RESPECT|RETURNING|RLIKE|ROLLUP|ROW|ROWID|ROWNUM|ROWS|ROW_NUMBER|RTRIM|SCHEMAS|SCROLL|SECOND|SECONDS|SECOND_MICROSECOND|SENSITIVE|SEPARATOR|SESSION|SHARE|SHOW|SIGNAL|SIMILAR|SIZE|SMALLINT|SOUNDS|SPACE|SPATIAL|SPECIFIC|SQL|SQLCODE|SQLERROR|SQLEXCEPTION|SQLID|SQLSTATE|SQLWARNING|SQL_BIG_RESULT|SQL_BUFFER_RESULT|SQL_CACHE|SQL_CALC_FOUND_ROWS|SQL_NO_CACHE|SQL_SMALL_RESULT|SSL|START|STARTING|STATS_AUTO_RECALC|STATS_PERSISTENT|STATS_SAMPLE_PAGES|STDDEV_POP|STDDEV_SAMP|STORED|STRAIGHT_JOIN|SUBSTRING|SUCCESSFUL|SUM|SYMMETRIC|SYNONYM|SYSDATE|SYSTEM|TEMPORARY|TERMINATED|TIMEZONE_HOUR|TIMEZONE_MINUTE|TINYBLOB|TINYINT|TINYTEXT|TRAILING|TRANSLATE|TRANSLATION|TREAT|TRIM|TRUE|UESCAPE|UID|UNBOUNDED|UNDO|UNKNOWN|UNLOCK|UNNEST|UNSIGNED|UPPER|USAGE|USING|UTC_DATE|UTC_TIME|UTC_TIMESTAMP|VALIDATE|VALUE|VARBINARY|VARCHAR|VARCHAR2|VARCHARACTER|VARIADIC|VAR_POP|VAR_SAMP|VERBOSE|VIRTUAL|WHENEVER|WINDOW|WITHIN|WITHOUT|WORK|WRITE|XML|XMLCAST|XMLEXISTS|XMLFOREST|XMLPARSE|XMLQUERY|XMLROOT|XMLSERIALIZE|XOR|YEAR|YEARS|YEAR_MONTH|ZEROFILL)$' replace: '[\1]' transform_relation_name: - order: 1000 comment: 'Protect reserved keywords' - search: '(?i)^(ACCESS|ACCESSIBLE|ALLOCATE|ANALYSE|ANALYZE|ARE|ARRAY|ASENSITIVE|ASSERTION|ASYMMETRIC|AT|AUDIT|AUTOINCREMENT|AVG|BEFORE|BIGINT|BINARY|BIT|BLOB|BOOLEAN|BOTH|CALL|CASCADED|CAST|CHANGE|CHAR|CHARACTER|CHARACTER_LENGTH|CLUSTER|COLLATION|COMMENT|COMPRESS|CONCAT|CONCURRENTLY|CONDITION|CONNECT|CONNECTION|CONSTRAINTS|CORRESPONDING|COUNT|CUBE|CUME_DIST|CURRENT_CATALOG|CURRENT_PATH|CURRENT_ROLE|CURRENT_SCHEMA|DATABASES|DATE|DAY|DAYS|DAY_HOUR|DAY_MICROSECOND|DAY_MINUTE|DAY_SECOND|DEC|DECIMAL|DEFERRABLE|DEFERRED|DEFINE|DEFINER|DELAYED|DENSE_RANK|DESCRIBE|DETERMINISTIC|DIAGNOSTICS|DISCONNECT|DISTINCTROW|DIV|DO|DUAL|EACH|ELSEIF|EMPTY|ENCLOSED|ENUM|ESCAPED|EXCEPTION|EXCLUDE|EXCLUSIVE|EXPLAIN|EXTRACT|FALSE|FILTER|FIRST|FIRST_VALUE|FLOAT|FLOAT4|FLOAT8|FOLLOWING|FORCE|FOUND|FREEZE|FULLTEXT|GENERATED|GET|GLOB|GLOBAL|GO|GROUPING|GROUPS|HASH|HIGH_PRIORITY|HOUR|HOURS|HOUR_MICROSECOND|HOUR_MINUTE|HOUR_SECOND|IDENTIFIED|IGNORE|ILIKE|IMMEDIATE|INCREMENT|INDEXED|INDICATOR|INFILE|INITIAL|INITIALLY|INOUT|INPUT|INSENSITIVE|INT|INT1|INT2|INT3|INT4|INT8|INTEGER|INTERVAL|INVOKER|IO_AFTER_GTIDS|IO_BEFORE_GTIDS|ISNULL|ISOLATION|ITERATE|JSON_ARRAYAGG|JSON_EXISTS|JSON_OBJECTAGG|JSON_TABLE|KEYS|LAG|LAST|LAST_VALUE|LATERAL|LEAD|LEADING|LEAVE|LEVEL|LIMIT|LINEAR|LINES|LOAD|LOCALTIME|LOCALTIMESTAMP|LOCK|LONG|LONGBLOB|LONGTEXT|LOOP|LOWER|LOW_PRIORITY|LTRIM|MASTER_BIND|MASTER_SSL_VERIFY_SERVER_CERT|MATCH|MAX|MAXEXTENTS|MAXVALUE|MEDIUMBLOB|MEDIUMINT|MEDIUMTEXT|MEMBER|MICROSECOND|MICROSECONDS|MIDDLEINT|MIN|MINUS|MINUTE|MINUTES|MINUTE_MICROSECOND|MINUTE_SECOND|MLSLABEL|MOD|MODE|MODIFIES|MODIFY|MONTH|MONTHS|NATURAL|NCHAR|NEW|NEXT|NO|NOAUDIT|NOCOMPRESS|NONE|NOTHING|NOTNULL|NOWAIT|NO_WRITE_TO_BINLOG|NTH_VALUE|NTILE|NULLS|NUMBER|NUMERIC|NVARCHAR|OFFLINE|OFFSET|ONLINE|ONLY|OPTIMIZE|OPTIMIZER_COSTS|OPTIONALLY|OUT|OUTFILE|OUTPUT|OVERLAPS|PAD|PARALLEL|PARTIAL|PARTITION|PCTFREE|PERCENTILE_CONT|PERCENTILE_DISC|PERCENT_RANK|PLACING|PORTION|POSITION|PRECEDING|PRECISION|PREPARE|PRESERVE|PRIOR|PRIVILEGES|PURGE|RAISE|RANGE|RANK|RAW|READS|READ_WRITE|REAL|RECURSIVE|REGEXP|RELATIVE|RELEASE|RENAME|REPEAT|REPLACE|REQUIRE|RESIGNAL|RESOURCE|RESPECT|RETURNING|RLIKE|ROLLUP|ROW|ROWID|ROWNUM|ROWS|ROW_NUMBER|RTRIM|SCHEMAS|SCROLL|SECOND|SECONDS|SECOND_MICROSECOND|SENSITIVE|SEPARATOR|SESSION|SHARE|SHOW|SIGNAL|SIMILAR|SIZE|SMALLINT|SOUNDS|SPACE|SPATIAL|SPECIFIC|SQL|SQLCODE|SQLERROR|SQLEXCEPTION|SQLID|SQLSTATE|SQLWARNING|SQL_BIG_RESULT|SQL_BUFFER_RESULT|SQL_CACHE|SQL_CALC_FOUND_ROWS|SQL_NO_CACHE|SQL_SMALL_RESULT|SSL|START|STARTING|STATS_AUTO_RECALC|STATS_PERSISTENT|STATS_SAMPLE_PAGES|STDDEV_POP|STDDEV_SAMP|STORED|STRAIGHT_JOIN|SUBSTRING|SUCCESSFUL|SUM|SYMMETRIC|SYNONYM|SYSDATE|SYSTEM|TEMPORARY|TERMINATED|TIMEZONE_HOUR|TIMEZONE_MINUTE|TINYBLOB|TINYINT|TINYTEXT|TRAILING|TRANSLATE|TRANSLATION|TREAT|TRIM|TRUE|UESCAPE|UID|UNBOUNDED|UNDO|UNKNOWN|UNLOCK|UNNEST|UNSIGNED|UPPER|USAGE|USING|UTC_DATE|UTC_TIME|UTC_TIMESTAMP|VALIDATE|VALUE|VARBINARY|VARCHAR|VARCHAR2|VARCHARACTER|VARIADIC|VAR_POP|VAR_SAMP|VERBOSE|VIRTUAL|WHENEVER|WINDOW|WITHIN|WITHOUT|WORK|WRITE|XML|XMLCAST|XMLEXISTS|XMLFOREST|XMLPARSE|XMLQUERY|XMLROOT|XMLSERIALIZE|XOR|YEAR|YEARS|YEAR_MONTH|ZEROFILL)$' + search: '(?i)^(ACCESS|ACCESSIBLE|ALLOCATE|ANALYSE|ANALYZE|ARE|ARRAY|ASENSITIVE|ASSERTION|ASYMMETRIC|AT|AUDIT|AUTOINCREMENT|AVG|BEFORE|BIGINT|BINARY|BIT|BLOB|BOOLEAN|BOTH|CALL|CASCADED|CAST|CHANGE|CHAR|CHARACTER|CHARACTER_LENGTH|CLUSTER|COLLATION|COMMENT|COMPRESS|CONCAT|CONCURRENTLY|CONDITION|CONNECT|CONNECTION|CONSTRAINTS|CORRESPONDING|COUNT|CUBE|CUME_DIST|CURRENT_CATALOG|CURRENT_PATH|CURRENT_ROLE|CURRENT_SCHEMA|DATABASES|DATE|DAY|DAYS|DAY_HOUR|DAY_MICROSECOND|DAY_MINUTE|DAY_SECOND|DEC|DECIMAL|DEFERRABLE|DEFERRED|DEFINE|DEFINER|DELAYED|DENSE_RANK|DESCRIBE|DETERMINISTIC|DIAGNOSTICS|DISCONNECT|DISTINCTROW|DIV|DO|DUAL|EACH|ELSEIF|EMPTY|ENCLOSED|ENUM|ESCAPED|EXCEPTION|EXCLUDE|EXCLUSIVE|EXPLAIN|EXTRACT|FALSE|FILTER|FIRST|FIRST_VALUE|FLOAT|FLOAT4|FLOAT8|FOLLOWING|FORCE|FOUND|FREEZE|FULLTEXT|GENERATED|GET|GLOB|GLOBAL|GO|GROUPING|GROUPS|HASH|HIGH_PRIORITY|HOUR|HOURS|HOUR_MICROSECOND|HOUR_MINUTE|HOUR_SECOND|IDENTIFIED|IGNORE|ILIKE|IMMEDIATE|INCREMENT|INDEXED|INDICATOR|INFILE|INITIAL|INITIALLY|INOUT|INPUT|INSENSITIVE|INT|INT1|INT2|INT3|INT4|INT8|INTEGER|INTERVAL|INVOKER|IO_AFTER_GTIDS|IO_BEFORE_GTIDS|ISNULL|ISOLATION|ITERATE|JSON_ARRAYAGG|JSON_EXISTS|JSON_OBJECTAGG|JSON_TABLE|KEYS|LAG|LAST|LAST_VALUE|LATERAL|LEAD|LEADING|LEAVE|LEVEL|LIMIT|LINEAR|LINES|LOAD|LOCALTIME|LOCALTIMESTAMP|LOCK|LONG|LONGBLOB|LONGTEXT|LOOP|LOWER|LOW_PRIORITY|LTRIM|MASTER_BIND|MASTER_SSL_VERIFY_SERVER_CERT|MATCH|MAX|MAXEXTENTS|MAXVALUE|MEDIUMBLOB|MEDIUMINT|MEDIUMTEXT|MEMBER|MICROSECOND|MICROSECONDS|MIDDLEINT|MIN|MINUS|MINUTE|MINUTES|MINUTE_MICROSECOND|MINUTE_SECOND|MLSLABEL|MOD|MODE|MODIFIES|MODIFY|MONTH|MONTHS|NATURAL|NCHAR|NEW|NEXT|NO|NOAUDIT|NOCOMPRESS|NONE|NOTHING|NOTNULL|NOWAIT|NO_WRITE_TO_BINLOG|NTH_VALUE|NTILE|NULLS|NUMBER|NUMERIC|NVARCHAR|OFFLINE|OFFSET|ONLINE|ONLY|OPTIMIZE|OPTIMIZER_COSTS|OPTIONALLY|OUT|OUTFILE|OUTPUT|OVERLAPS|PAD|PARTIAL|PARTITION|PCTFREE|PERCENTILE_CONT|PERCENTILE_DISC|PERCENT_RANK|PLACING|PORTION|POSITION|PRECEDING|PRECISION|PREPARE|PRESERVE|PRIOR|PRIVILEGES|PURGE|RAISE|RANGE|RANK|RAW|READS|READ_WRITE|REAL|RECURSIVE|REGEXP|RELATIVE|RELEASE|RENAME|REPEAT|REPLACE|REQUIRE|RESIGNAL|RESOURCE|RESPECT|RETURNING|RLIKE|ROLLUP|ROW|ROWID|ROWNUM|ROWS|ROW_NUMBER|RTRIM|SCHEMAS|SCROLL|SECOND|SECONDS|SECOND_MICROSECOND|SENSITIVE|SEPARATOR|SESSION|SHARE|SHOW|SIGNAL|SIMILAR|SIZE|SMALLINT|SOUNDS|SPACE|SPATIAL|SPECIFIC|SQL|SQLCODE|SQLERROR|SQLEXCEPTION|SQLID|SQLSTATE|SQLWARNING|SQL_BIG_RESULT|SQL_BUFFER_RESULT|SQL_CACHE|SQL_CALC_FOUND_ROWS|SQL_NO_CACHE|SQL_SMALL_RESULT|SSL|START|STARTING|STATS_AUTO_RECALC|STATS_PERSISTENT|STATS_SAMPLE_PAGES|STDDEV_POP|STDDEV_SAMP|STORED|STRAIGHT_JOIN|SUBSTRING|SUCCESSFUL|SUM|SYMMETRIC|SYNONYM|SYSDATE|SYSTEM|TEMPORARY|TERMINATED|TIMEZONE_HOUR|TIMEZONE_MINUTE|TINYBLOB|TINYINT|TINYTEXT|TRAILING|TRANSLATE|TRANSLATION|TREAT|TRIM|TRUE|UESCAPE|UID|UNBOUNDED|UNDO|UNKNOWN|UNLOCK|UNNEST|UNSIGNED|UPPER|USAGE|USING|UTC_DATE|UTC_TIME|UTC_TIMESTAMP|VALIDATE|VALUE|VARBINARY|VARCHAR|VARCHAR2|VARCHARACTER|VARIADIC|VAR_POP|VAR_SAMP|VERBOSE|VIRTUAL|WHENEVER|WINDOW|WITHIN|WITHOUT|WORK|WRITE|XML|XMLCAST|XMLEXISTS|XMLFOREST|XMLPARSE|XMLQUERY|XMLROOT|XMLSERIALIZE|XOR|YEAR|YEARS|YEAR_MONTH|ZEROFILL)$' replace: '[\1]' transform_datatype: - order: 200 diff --git a/test/zoo/alt/mld/alt_0_mld.tex b/test/zoo/alt/mld/alt_0_mld.tex index 1bdd1048..7bf0980b 100644 --- a/test/zoo/alt/mld/alt_0_mld.tex +++ b/test/zoo/alt/mld/alt_0_mld.tex @@ -16,7 +16,7 @@ \maketitle \begin{itemize} - \item \relat{CLIENT} (\prim{Réf. client}, \attr{Nom}$^{u_1}$, \attr{Prénom}$^{u_1}$, \attr{Adresse}, \attr{Mail}$^{u_2}$) + \item \relat{CLIENT} (\prim{Réf. client}, \attr{Nom}$^{u\_1}$, \attr{Prénom}$^{u\_1}$, \attr{Adresse}, \attr{Mail}$^{u\_2}$) \begin{itemize} \item Le champ \emph{Réf. client} constitue la clé primaire de la table. C'était déjà un identifiant de l'entité \emph{CLIENT}. \item Les champs \emph{Nom} et \emph{Prénom} étaient déjà de simples attributs de l'entité \emph{CLIENT}. Il obéit à la contrainte d'unicité 1. @@ -24,7 +24,7 @@ \item Le champ \emph{Mail} était déjà un simple attribut de l'entité \emph{CLIENT}. Il obéit à la contrainte d'unicité 2. \end{itemize} - \item \relat{FOO} (\prim{foo}, \attr{bar}$^{u_1}$, \attr{biz}$^{u_1 u_2}$, \attr{buz}$^{u_2}$, \attr{qux}$^{u_3}$, \attr{quux}$^{u_1 u_2 u_3}$) + \item \relat{FOO} (\prim{foo}, \attr{bar}$^{u\_1}$, \attr{biz}$^{u\_1 u\_2}$, \attr{buz}$^{u\_2}$, \attr{qux}$^{u\_3}$, \attr{quux}$^{u\_1 u\_2 u\_3}$) \begin{itemize} \item Le champ \emph{foo} constitue la clé primaire de la table. C'était déjà un identifiant de l'entité \emph{FOO}. \item Le champ \emph{bar} était déjà un simple attribut de l'entité \emph{FOO}. Il obéit à la contrainte d'unicité 1. @@ -34,7 +34,7 @@ \item Le champ \emph{quux} était déjà un simple attribut de l'entité \emph{FOO}. Il obéit aux contraintes d'unicité 1, 2 et 3. \end{itemize} - \item \relat{UTILISER} (\prim{carnet}$^{u_1}$, \prim{projet}$^{u_2}$, \attr{technicien}$^{u_1 u_2}$) + \item \relat{UTILISER} (\prim{carnet}$^{u\_1}$, \prim{projet}$^{u\_2}$, \attr{technicien}$^{u\_1 u\_2}$) \begin{itemize} \item Le champ \emph{carnet} fait partie de la clé primaire de la table. C'était déjà un identifiant de l'entité \emph{UTILISER}. Il obéit en outre à la contrainte d'unicité 1. \item Le champ \emph{projet} fait partie de la clé primaire de la table. C'était déjà un identifiant de l'entité \emph{UTILISER}. Il obéit en outre à la contrainte d'unicité 2. diff --git a/test/zoo/cluster_NN1/mld/cluster_NN1_0_mld.tex b/test/zoo/cluster_NN1/mld/cluster_NN1_0_mld.tex index ef30e603..a66cea07 100644 --- a/test/zoo/cluster_NN1/mld/cluster_NN1_0_mld.tex +++ b/test/zoo/cluster_NN1/mld/cluster_NN1_0_mld.tex @@ -9,14 +9,14 @@ \newcommand{\prim}[1]{\uline{#1}} \newcommand{\foreign}[1]{\#\textsl{#1}} -\title{Conversion en relationnel\\du MCD \emph{cluster_NN1}} +\title{Conversion en relationnel\\du MCD \emph{cluster\_NN1}} \author{\emph{Généré par Mocodo}} \begin{document} \maketitle \begin{itemize} - \item \relat{Réservation} (\prim{num résa}, \attr{arrhes}, \attr{date résa}, \foreign{num voilier}$^{u_1}$, \foreign{num semaine}$^{u_1}$, \attr{tarif}) + \item \relat{Réservation} (\prim{num résa}, \attr{arrhes}, \attr{date résa}, \foreign{num voilier}$^{u\_1}$, \foreign{num semaine}$^{u\_1}$, \attr{tarif}) \begin{itemize} \item Le champ \emph{num résa} constitue la clé primaire de la table. C'était déjà un identifiant de l'entité \emph{Réservation}. \item Les champs \emph{arrhes} et \emph{date résa} étaient déjà de simples attributs de l'entité \emph{Réservation}. @@ -25,7 +25,7 @@ \item Le champ \emph{tarif} a migré à partir de l'association de dépendance fonctionnelle \emph{Offrir}. \end{itemize} - \item \relat{Semaine} (\prim{num semaine}, \attr{date début}$^{u_1}$) + \item \relat{Semaine} (\prim{num semaine}, \attr{date début}$^{u\_1}$) \begin{itemize} \item Le champ \emph{num semaine} constitue la clé primaire de la table. C'était déjà un identifiant de l'entité \emph{Semaine}. \item Le champ \emph{date début} était déjà un simple attribut de l'entité \emph{Semaine}. Il obéit à la contrainte d'unicité 1. diff --git a/test/zoo/complex/mld/complex_mld.tex b/test/zoo/complex/mld/complex_mld.tex index 02f40006..da0bc69d 100644 --- a/test/zoo/complex/mld/complex_mld.tex +++ b/test/zoo/complex/mld/complex_mld.tex @@ -29,7 +29,7 @@ \item Le champ à saisie facultative \emph{plante préférée} a migré à partir de l'entité-fille \emph{HERBIVORE} (supprimée). \end{itemize} - \item \relat{ESPÈCE} (\prim{code espèce}, \attr{nom latin}$^{u_1}$, \attr{nom vernaculaire}) + \item \relat{ESPÈCE} (\prim{code espèce}, \attr{nom latin}$^{u\_1}$, \attr{nom vernaculaire}) \begin{itemize} \item Le champ \emph{code espèce} constitue la clé primaire de la table. C'était déjà un identifiant de l'entité \emph{ESPÈCE}. \item Le champ \emph{nom latin} était déjà un simple attribut de l'entité \emph{ESPÈCE}. Il obéit à la contrainte d'unicité 1. diff --git a/test/zoo/drain/mld/drain_mld.tex b/test/zoo/drain/mld/drain_mld.tex index 931416b3..a8913f1c 100644 --- a/test/zoo/drain/mld/drain_mld.tex +++ b/test/zoo/drain/mld/drain_mld.tex @@ -22,7 +22,7 @@ \item Les champs \emph{adresse} et \emph{téléphone} étaient déjà de simples attributs de l'entité \emph{Entreprise}. \end{itemize} - \item \relat{Étudiant} (\prim{num étudiant}, \attr{nom}, \foreign{num. stage}$^{u_1}$, \attr{date signature}, \attr{date?}, \attr{note stage}) + \item \relat{Étudiant} (\prim{num étudiant}, \attr{nom}, \foreign{num. stage}$^{u\_1}$, \attr{date signature}, \attr{date?}, \attr{note stage}) \begin{itemize} \item Le champ \emph{num étudiant} constitue la clé primaire de la table. C'était déjà un identifiant de l'entité \emph{Étudiant}. \item Le champ \emph{nom} était déjà un simple attribut de l'entité \emph{Étudiant}. diff --git a/test/zoo/empty_attrs/mld/empty_attrs_0_mld.tex b/test/zoo/empty_attrs/mld/empty_attrs_0_mld.tex index e744e539..5051d62d 100644 --- a/test/zoo/empty_attrs/mld/empty_attrs_0_mld.tex +++ b/test/zoo/empty_attrs/mld/empty_attrs_0_mld.tex @@ -9,7 +9,7 @@ \newcommand{\prim}[1]{\uline{#1}} \newcommand{\foreign}[1]{\#\textsl{#1}} -\title{Conversion en relationnel\\du MCD \emph{empty_attrs}} +\title{Conversion en relationnel\\du MCD \emph{empty\_attrs}} \author{\emph{Généré par Mocodo}} \begin{document} diff --git a/test/zoo/inheritance/mld/inheritance_3_mld.tex b/test/zoo/inheritance/mld/inheritance_3_mld.tex index e6b394a2..d8e01606 100644 --- a/test/zoo/inheritance/mld/inheritance_3_mld.tex +++ b/test/zoo/inheritance/mld/inheritance_3_mld.tex @@ -16,7 +16,7 @@ \maketitle \begin{itemize} - \item \relat{TRISTIS} (\prim{magna}, \attr{vestibulum}, \attr{type!}, \attr{convallis?}, \attr{ipsum?}, \attr{pulvinar?}, \attr{audis?}, \foreign{magna via_mollis?}, \foreign{magna via_vitae?}, \attr{tempor?}, \attr{fugit?}) + \item \relat{TRISTIS} (\prim{magna}, \attr{vestibulum}, \attr{type!}, \attr{convallis?}, \attr{ipsum?}, \attr{pulvinar?}, \attr{audis?}, \foreign{magna via\_mollis?}, \foreign{magna via\_vitae?}, \attr{tempor?}, \attr{fugit?}) \begin{itemize} \item Le champ \emph{magna} constitue la clé primaire de la table. C'était déjà un identifiant de l'entité \emph{TRISTIS}. \item Le champ \emph{vestibulum} était déjà un simple attribut de l'entité \emph{TRISTIS}. @@ -25,8 +25,8 @@ \item Le champ à saisie facultative \emph{ipsum} a migré à partir de l'entité-fille \emph{SODALES} (supprimée). \item Le champ à saisie facultative \emph{pulvinar} a migré à partir de l'entité-fille \emph{NEC} (supprimée). \item Le champ à saisie facultative \emph{audis} a migré à partir de l'entité-fille \emph{NEC} (supprimée). - \item Le champ à saisie facultative \emph{magna via_mollis} est une clé étrangère. Il a migré à partir de l'entité-fille \emph{NEC} (supprimée) dans laquelle il avait déjà migré à partir de l'entité \emph{TRISTIS}. - \item Le champ à saisie facultative \emph{magna via_vitae} est une clé étrangère. Il a migré à partir de l'entité-fille \emph{NEC} (supprimée) dans laquelle il avait déjà migré à partir de l'entité \emph{TRISTIS}. + \item Le champ à saisie facultative \emph{magna via\_mollis} est une clé étrangère. Il a migré à partir de l'entité-fille \emph{NEC} (supprimée) dans laquelle il avait déjà migré à partir de l'entité \emph{TRISTIS}. + \item Le champ à saisie facultative \emph{magna via\_vitae} est une clé étrangère. Il a migré à partir de l'entité-fille \emph{NEC} (supprimée) dans laquelle il avait déjà migré à partir de l'entité \emph{TRISTIS}. \item Le champ à saisie facultative \emph{tempor} a migré à partir de l'entité-fille \emph{LACUS} (supprimée). \item Le champ à saisie facultative \emph{fugit} a migré à partir de l'entité-fille \emph{LACUS} (supprimée). \end{itemize} diff --git a/test/zoo/inheritance/mld/inheritance_4_mld.tex b/test/zoo/inheritance/mld/inheritance_4_mld.tex index db87caf4..337cae37 100644 --- a/test/zoo/inheritance/mld/inheritance_4_mld.tex +++ b/test/zoo/inheritance/mld/inheritance_4_mld.tex @@ -22,12 +22,12 @@ \item Les champs \emph{tempor} et \emph{fugit} étaient déjà de simples attributs de l'entité \emph{LACUS}. \end{itemize} - \item \relat{NEC} (\foreign{\prim{magna}}, \attr{pulvinar}, \attr{audis}, \foreign{magna via_mollis!}, \foreign{magna via_vitae!}) + \item \relat{NEC} (\foreign{\prim{magna}}, \attr{pulvinar}, \attr{audis}, \foreign{magna via\_mollis!}, \foreign{magna via\_vitae!}) \begin{itemize} \item Le champ \emph{magna} constitue la clé primaire de la table. C'est une clé étrangère qui a migré à partir de l'entité-mère \emph{TRISTIS}. \item Les champs \emph{pulvinar} et \emph{audis} étaient déjà de simples attributs de l'entité \emph{NEC}. - \item Le champ à saisie obligatoire \emph{magna via_mollis} est une clé étrangère. Il a migré par l'association de dépendance fonctionnelle \emph{MOLLIS} à partir de l'entité \emph{LACUS} en perdant son caractère identifiant. - \item Le champ à saisie obligatoire \emph{magna via_vitae} est une clé étrangère. Il a migré par l'association de dépendance fonctionnelle \emph{VITAE} à partir de l'entité \emph{SODALES} en perdant son caractère identifiant. + \item Le champ à saisie obligatoire \emph{magna via\_mollis} est une clé étrangère. Il a migré par l'association de dépendance fonctionnelle \emph{MOLLIS} à partir de l'entité \emph{LACUS} en perdant son caractère identifiant. + \item Le champ à saisie obligatoire \emph{magna via\_vitae} est une clé étrangère. Il a migré par l'association de dépendance fonctionnelle \emph{VITAE} à partir de l'entité \emph{SODALES} en perdant son caractère identifiant. \end{itemize} \item \relat{SODALES} (\foreign{\prim{magna}}, \attr{convallis}, \attr{ipsum}) diff --git a/test/zoo/inheritance/mld/inheritance_5_mld.tex b/test/zoo/inheritance/mld/inheritance_5_mld.tex index a5a7d148..ced6988a 100644 --- a/test/zoo/inheritance/mld/inheritance_5_mld.tex +++ b/test/zoo/inheritance/mld/inheritance_5_mld.tex @@ -23,13 +23,13 @@ \item Les champs \emph{tempor} et \emph{fugit} étaient déjà de simples attributs de l'entité \emph{LACUS}. \end{itemize} - \item \relat{NEC} (\prim{magna}, \attr{vestibulum}, \attr{pulvinar}, \attr{audis}, \foreign{magna via_mollis!}, \foreign{magna via_vitae!}) + \item \relat{NEC} (\prim{magna}, \attr{vestibulum}, \attr{pulvinar}, \attr{audis}, \foreign{magna via\_mollis!}, \foreign{magna via\_vitae!}) \begin{itemize} \item Le champ \emph{magna} constitue la clé primaire de la table. Il était clé primaire de l'entité-mère \emph{TRISTIS} (supprimée). \item Le champ \emph{vestibulum} est un simple attribut. Il était simple attribut de l'entité-mère \emph{TRISTIS} (supprimée). \item Les champs \emph{pulvinar} et \emph{audis} étaient déjà de simples attributs de l'entité \emph{NEC}. - \item Le champ à saisie obligatoire \emph{magna via_mollis} est une clé étrangère. Il a migré par l'association de dépendance fonctionnelle \emph{MOLLIS} à partir de l'entité \emph{LACUS} en perdant son caractère identifiant. - \item Le champ à saisie obligatoire \emph{magna via_vitae} est une clé étrangère. Il a migré par l'association de dépendance fonctionnelle \emph{VITAE} à partir de l'entité \emph{SODALES} en perdant son caractère identifiant. + \item Le champ à saisie obligatoire \emph{magna via\_mollis} est une clé étrangère. Il a migré par l'association de dépendance fonctionnelle \emph{MOLLIS} à partir de l'entité \emph{LACUS} en perdant son caractère identifiant. + \item Le champ à saisie obligatoire \emph{magna via\_vitae} est une clé étrangère. Il a migré par l'association de dépendance fonctionnelle \emph{VITAE} à partir de l'entité \emph{SODALES} en perdant son caractère identifiant. \end{itemize} \item \relat{SODALES} (\prim{magna}, \attr{vestibulum}, \attr{convallis}, \attr{ipsum}) diff --git a/test/zoo/ternary_unicity/mld/ternary_unicity_0_mld.tex b/test/zoo/ternary_unicity/mld/ternary_unicity_0_mld.tex index 3a55f904..a4729d2f 100644 --- a/test/zoo/ternary_unicity/mld/ternary_unicity_0_mld.tex +++ b/test/zoo/ternary_unicity/mld/ternary_unicity_0_mld.tex @@ -9,7 +9,7 @@ \newcommand{\prim}[1]{\uline{#1}} \newcommand{\foreign}[1]{\#\textsl{#1}} -\title{Conversion en relationnel\\du MCD \emph{ternary_unicity}} +\title{Conversion en relationnel\\du MCD \emph{ternary\_unicity}} \author{\emph{Généré par Mocodo}} \begin{document} @@ -22,7 +22,7 @@ \item Le champ \emph{voilier} fait partie de la clé primaire de la table. Il a migré à partir de l'entité \emph{Voilier} pour renforcer l'identifiant. Cependant, comme la table créée à partir de cette entité a été supprimée, il n'est pas considéré comme clé étrangère. \end{itemize} - \item \relat{Réservation} (\prim{id résa}, \attr{num résa}$^{u_1}$, \attr{arrhes}, \attr{date réservation}, \foreign{semaine}$^{u_2}$, \foreign{voilier}$^{u_2}$) + \item \relat{Réservation} (\prim{id résa}, \attr{num résa}$^{u\_1}$, \attr{arrhes}, \attr{date réservation}, \foreign{semaine}$^{u\_2}$, \foreign{voilier}$^{u\_2}$) \begin{itemize} \item Le champ \emph{id résa} constitue la clé primaire de la table. C'était déjà un identifiant de l'entité \emph{Réservation}. \item Le champ \emph{num résa} était déjà un simple attribut de l'entité \emph{Réservation}. Il obéit à la contrainte d'unicité 1. @@ -30,7 +30,7 @@ \item Les champs \emph{semaine} et \emph{voilier} sont des clés étrangères. Ils ont migré par l'association de dépendance fonctionnelle \emph{DF} à partir de l'entité \emph{Disponibilité} en perdant leur caractère identifiant. Ils obéissent en outre à la contrainte d'unicité 2. \end{itemize} - \item \relat{Semaine} (\prim{semaine}, \attr{date début}$^{u_1}$) + \item \relat{Semaine} (\prim{semaine}, \attr{date début}$^{u\_1}$) \begin{itemize} \item Le champ \emph{semaine} constitue la clé primaire de la table. C'était déjà un identifiant de l'entité \emph{Semaine}. \item Le champ \emph{date début} était déjà un simple attribut de l'entité \emph{Semaine}. Il obéit à la contrainte d'unicité 1. diff --git a/test/zoo/triple_111/mld/triple_111_0_mld.tex b/test/zoo/triple_111/mld/triple_111_0_mld.tex index c0381ef8..9ffcb9ca 100644 --- a/test/zoo/triple_111/mld/triple_111_0_mld.tex +++ b/test/zoo/triple_111/mld/triple_111_0_mld.tex @@ -9,14 +9,14 @@ \newcommand{\prim}[1]{\uline{#1}} \newcommand{\foreign}[1]{\#\textsl{#1}} -\title{Conversion en relationnel\\du MCD \emph{triple_111}} +\title{Conversion en relationnel\\du MCD \emph{triple\_111}} \author{\emph{Généré par Mocodo}} \begin{document} \maketitle \begin{itemize} - \item \relat{Utiliser} (\prim{carnet}$^{u_1}$, \prim{projet}$^{u_2}$, \attr{technicien}$^{u_1 u_2}$) + \item \relat{Utiliser} (\prim{carnet}$^{u\_1}$, \prim{projet}$^{u\_2}$, \attr{technicien}$^{u\_1 u\_2}$) \begin{itemize} \item Le champ \emph{carnet} fait partie de la clé primaire de la table. Sa table d'origine (\emph{Carnet}) ayant été supprimée, il n'est pas considéré comme clé étrangère. Il obéit par contre à la contrainte d'unicité 1. \item Le champ \emph{projet} fait partie de la clé primaire de la table. Sa table d'origine (\emph{Projet}) ayant été supprimée, il n'est pas considéré comme clé étrangère. Il obéit par contre à la contrainte d'unicité 2. diff --git a/test/zoo/triple_111/mld/triple_111_1_mld.tex b/test/zoo/triple_111/mld/triple_111_1_mld.tex index 520cf980..947bb109 100644 --- a/test/zoo/triple_111/mld/triple_111_1_mld.tex +++ b/test/zoo/triple_111/mld/triple_111_1_mld.tex @@ -9,7 +9,7 @@ \newcommand{\prim}[1]{\uline{#1}} \newcommand{\foreign}[1]{\#\textsl{#1}} -\title{Conversion en relationnel\\du MCD \emph{triple_111}} +\title{Conversion en relationnel\\du MCD \emph{triple\_111}} \author{\emph{Généré par Mocodo}} \begin{document} @@ -28,7 +28,7 @@ \item Le champ \emph{nom technicien} était déjà un simple attribut de l'entité \emph{Technicien}. \end{itemize} - \item \relat{Utiliser} (\prim{carnet}$^{u_1}$, \foreign{\prim{projet}}$^{u_2}$, \foreign{technicien}$^{u_1 u_2}$) + \item \relat{Utiliser} (\prim{carnet}$^{u\_1}$, \foreign{\prim{projet}}$^{u\_2}$, \foreign{technicien}$^{u\_1 u\_2}$) \begin{itemize} \item Le champ \emph{carnet} fait partie de la clé primaire de la table. Sa table d'origine (\emph{Carnet}) ayant été supprimée, il n'est pas considéré comme clé étrangère. Il obéit par contre à la contrainte d'unicité 1. \item Le champ \emph{projet} fait partie de la clé primaire de la table. C'est une clé étrangère qui a migré directement à partir de l'entité \emph{Projet}. Il obéit en outre à la contrainte d'unicité 2. diff --git a/test/zoo/triple_N11/mld/triple_N11_0_mld.tex b/test/zoo/triple_N11/mld/triple_N11_0_mld.tex index 9116357d..871914af 100644 --- a/test/zoo/triple_N11/mld/triple_N11_0_mld.tex +++ b/test/zoo/triple_N11/mld/triple_N11_0_mld.tex @@ -9,14 +9,14 @@ \newcommand{\prim}[1]{\uline{#1}} \newcommand{\foreign}[1]{\#\textsl{#1}} -\title{Conversion en relationnel\\du MCD \emph{triple_N11}} +\title{Conversion en relationnel\\du MCD \emph{triple\_N11}} \author{\emph{Généré par Mocodo}} \begin{document} \maketitle \begin{itemize} - \item \relat{Affecter} (\prim{projet}, \prim{employé}$^{u_1}$, \attr{site}$^{u_1}$) + \item \relat{Affecter} (\prim{projet}, \prim{employé}$^{u\_1}$, \attr{site}$^{u\_1}$) \begin{itemize} \item Le champ \emph{projet} fait partie de la clé primaire de la table. Sa table d'origine (\emph{Projet}) ayant été supprimée, il n'est pas considéré comme clé étrangère. \item Le champ \emph{employé} fait partie de la clé primaire de la table. Sa table d'origine (\emph{Employé}) ayant été supprimée, il n'est pas considéré comme clé étrangère. Il obéit par contre à la contrainte d'unicité 1. diff --git a/test/zoo/triple_N11/mld/triple_N11_1_mld.tex b/test/zoo/triple_N11/mld/triple_N11_1_mld.tex index 2c2f7044..ddd1dd88 100644 --- a/test/zoo/triple_N11/mld/triple_N11_1_mld.tex +++ b/test/zoo/triple_N11/mld/triple_N11_1_mld.tex @@ -9,14 +9,14 @@ \newcommand{\prim}[1]{\uline{#1}} \newcommand{\foreign}[1]{\#\textsl{#1}} -\title{Conversion en relationnel\\du MCD \emph{triple_N11}} +\title{Conversion en relationnel\\du MCD \emph{triple\_N11}} \author{\emph{Généré par Mocodo}} \begin{document} \maketitle \begin{itemize} - \item \relat{Affecter} (\foreign{\prim{projet}}, \foreign{\prim{employé}}$^{u_1}$, \foreign{site}$^{u_1}$) + \item \relat{Affecter} (\foreign{\prim{projet}}, \foreign{\prim{employé}}$^{u\_1}$, \foreign{site}$^{u\_1}$) \begin{itemize} \item Le champ \emph{projet} fait partie de la clé primaire de la table. C'est une clé étrangère qui a migré directement à partir de l'entité \emph{Projet}. \item Le champ \emph{employé} fait partie de la clé primaire de la table. C'est une clé étrangère qui a migré directement à partir de l'entité \emph{Employé}. Il obéit en outre à la contrainte d'unicité 1. diff --git a/test/zoo/triple_NN1/mld/triple_NN1_0_mld.tex b/test/zoo/triple_NN1/mld/triple_NN1_0_mld.tex index 06af48d4..3073dbb8 100644 --- a/test/zoo/triple_NN1/mld/triple_NN1_0_mld.tex +++ b/test/zoo/triple_NN1/mld/triple_NN1_0_mld.tex @@ -9,7 +9,7 @@ \newcommand{\prim}[1]{\uline{#1}} \newcommand{\foreign}[1]{\#\textsl{#1}} -\title{Conversion en relationnel\\du MCD \emph{triple_NN1}} +\title{Conversion en relationnel\\du MCD \emph{triple\_NN1}} \author{\emph{Généré par Mocodo}} \begin{document} diff --git a/test/zoo/triple_NN1/mld/triple_NN1_1_mld.tex b/test/zoo/triple_NN1/mld/triple_NN1_1_mld.tex index b8f5dd6f..9994574d 100644 --- a/test/zoo/triple_NN1/mld/triple_NN1_1_mld.tex +++ b/test/zoo/triple_NN1/mld/triple_NN1_1_mld.tex @@ -9,7 +9,7 @@ \newcommand{\prim}[1]{\uline{#1}} \newcommand{\foreign}[1]{\#\textsl{#1}} -\title{Conversion en relationnel\\du MCD \emph{triple_NN1}} +\title{Conversion en relationnel\\du MCD \emph{triple\_NN1}} \author{\emph{Généré par Mocodo}} \begin{document} diff --git a/test/zoo/triple_NNN/mld/triple_NNN_0_mld.tex b/test/zoo/triple_NNN/mld/triple_NNN_0_mld.tex index c36bcc27..42aa0ec1 100644 --- a/test/zoo/triple_NNN/mld/triple_NNN_0_mld.tex +++ b/test/zoo/triple_NNN/mld/triple_NNN_0_mld.tex @@ -9,7 +9,7 @@ \newcommand{\prim}[1]{\uline{#1}} \newcommand{\foreign}[1]{\#\textsl{#1}} -\title{Conversion en relationnel\\du MCD \emph{triple_NNN}} +\title{Conversion en relationnel\\du MCD \emph{triple\_NNN}} \author{\emph{Généré par Mocodo}} \begin{document} diff --git a/test/zoo/triple_NNN/mld/triple_NNN_1_mld.tex b/test/zoo/triple_NNN/mld/triple_NNN_1_mld.tex index 792cf8be..0f551574 100644 --- a/test/zoo/triple_NNN/mld/triple_NNN_1_mld.tex +++ b/test/zoo/triple_NNN/mld/triple_NNN_1_mld.tex @@ -9,7 +9,7 @@ \newcommand{\prim}[1]{\uline{#1}} \newcommand{\foreign}[1]{\#\textsl{#1}} -\title{Conversion en relationnel\\du MCD \emph{triple_NNN}} +\title{Conversion en relationnel\\du MCD \emph{triple\_NNN}} \author{\emph{Généré par Mocodo}} \begin{document} From 3bcff3158fc31a3c984e1b423d8a50182919bad0 Mon Sep 17 00:00:00 2001 From: Aristide Date: Mon, 15 Jan 2024 18:20:34 +0100 Subject: [PATCH 2/9] suppress `subprocess` dependency in magic --- mocodo/__init__.py | 18 ++- mocodo/__main__.py | 24 ++-- mocodo/argument_parser.py | 6 +- mocodo/common.py | 43 +++++-- mocodo/magic_command.py | 242 ++++++++++++++++-------------------- test/test_fitness.py | 16 +-- test/test_mcd.py | 2 +- test/test_mcd_dimensions.py | 2 +- test/test_relations.py | 2 +- test/test_zoo.py | 2 +- 10 files changed, 186 insertions(+), 171 deletions(-) diff --git a/mocodo/__init__.py b/mocodo/__init__.py index 9618c295..aad0a5a0 100644 --- a/mocodo/__init__.py +++ b/mocodo/__init__.py @@ -1,4 +1,16 @@ -import sys +import importlib -if "ipykernel" in sys.modules: - from . import magic_command +def load_ipython_extension(ipython): + # This function is called when the extension is loaded in a notebook + # with %load_ext mocodo or %reload_ext mocodo. + + mocodo = importlib.import_module("mocodo.magic_command").mocodo + ipython.register_magic_function(mocodo, 'line_cell', 'mocodo') + + pkg_resources = importlib.import_module("pkg_resources") + + try: + MOCODO_VERSION = pkg_resources.get_distribution("mocodo").version + except pkg_resources.DistributionNotFound: + MOCODO_VERSION = "(unknown version)" # For tests during CI + print(f"Mocodo {MOCODO_VERSION} loaded.") diff --git a/mocodo/__main__.py b/mocodo/__main__.py index 84a33d00..104a2583 100755 --- a/mocodo/__main__.py +++ b/mocodo/__main__.py @@ -9,7 +9,7 @@ import json from .argument_parser import parsed_arguments -from .common import Common, safe_print_for_PHP +from .common import Common, Printer from .convert.read_template import read_template from .convert.relations import Relations from .font_metrics import font_metrics_factory @@ -73,9 +73,10 @@ def flip(source, subargs): class Runner: - def __init__(self): + def __init__(self, args, printer): + self.printer = printer try: - self.params = parsed_arguments() + self.params = parsed_arguments(args) self.parsing_error = None self.common = Common(self.params) self.get_font_metrics = font_metrics_factory(self.params) @@ -93,7 +94,8 @@ def __call__(self): shutil = importlib.import_module("shutil") path = Path(self.params["script_directory"], "resources", "pristine_sandbox.mcd") shutil.copyfile(path, "sandbox.mcd") - return Path("params.json").write_text("{}\n", encoding="utf8") + Path("params.json").write_text("{}\n", encoding="utf8") + return if self.params["print_params"]: for added_key in self.params["keys_to_hide"][:]: @@ -102,7 +104,8 @@ def __call__(self): text = json.dumps(self.params, ensure_ascii=False, indent=2, sort_keys=True) text = text.replace("\n ", " ") text = text.replace("\n ]", " ]") - return safe_print_for_PHP(text.strip()) + self.printer.write(text.strip()) + return self.add_gutter_params(self.params) @@ -156,7 +159,7 @@ def __call__(self): source = module.run(source, subopt=subopt, subargs=subargs, params=self.params).rstrip() response.may_log("rewritten_source", source) if not self.params["is_magic"]: - safe_print_for_PHP(self.common.update_source(source)) + self.printer.write(self.common.update_source(source)) may_update_params_with_guessed_title(source, self.params) @@ -213,7 +216,8 @@ def __call__(self): result = module.run(source, subargs, self.common) result["text_path"] = Path(f"{self.params['output_name']}{result['stem_suffix']}.{result['extension']}") - self.common.dump_file(result["text_path"], f"{result['text'].rstrip()}\n") + result["text_path"].write_text(f"{result['text'].rstrip()}\n", encoding="utf8") + self.printer.write(self.common.output_success_message(result["text_path"])) results.append(result) for result in results: converted_file_paths.extend(self.get_converted_file_paths(result)) @@ -224,7 +228,7 @@ def __call__(self): self.control_for_overlaps(mcd) resulting_paths = dump_mcd_to_svg(mcd, self.common) # potential side-effect: update *_geo.json for path in resulting_paths: - safe_print_for_PHP(self.common.output_success_message(path)) + self.printer.write(self.common.output_success_message(path)) def get_rendering_service(self, extension): path = Path(self.params["script_directory"], "resources", "rendering_services.json") @@ -324,8 +328,10 @@ def add_gutter_params(self, params): # We are sure that gutters is a dict with keys "ids" and "types" only. Order matters. (params["left_gutter"], params["right_gutter"]) = tuple(gutters.keys()) + def main(): - run = Runner() + printer = Printer(accumulate=False) + run = Runner(sys.argv[1:], printer) try: run() except MocodoError as err: diff --git a/mocodo/argument_parser.py b/mocodo/argument_parser.py index ccecf42e..423c21df 100755 --- a/mocodo/argument_parser.py +++ b/mocodo/argument_parser.py @@ -153,7 +153,9 @@ def positive_integer(string): raise argparse.ArgumentTypeError(msg) return value -def parsed_arguments(): +def parsed_arguments(args): + # When mocodo is called from the command line, `args` is just `sys.argv[1:]`. + # When it is imported, `args` is a list of strings constructed with shlex.split(). parser = argparse.ArgumentParser( prog="mocodo", @@ -201,7 +203,7 @@ def parsed_arguments(): ) input_action = io_group._group_actions[-1] - (args, remaining_args) = parser.parse_known_args() + (args, remaining_args) = parser.parse_known_args(args) if not args.input: # no input file is specified, use the pristine sandbox diff --git a/mocodo/common.py b/mocodo/common.py index 58d33bfd..cc26b6ae 100755 --- a/mocodo/common.py +++ b/mocodo/common.py @@ -8,13 +8,34 @@ from .mocodo_error import MocodoError -def safe_print_for_PHP(s): - """ It seems that when called from PHP, Python is unable to guess correctly - the encoding of the standard output. """ - try: - print(s, file=sys.stdout) - except UnicodeEncodeError: - print(s.encode("utf8"), file=sys.stdout) +def contract_path(path): + """ + Contract a full path to one with ~, if it's under the user's home directory. + """ + home = str(Path.home()) + absolute_path = str(Path(path).resolve()) + if absolute_path.startswith(home): + return absolute_path.replace(home, '~', 1) + else: + return absolute_path + + +class Printer: + + def __init__(self, accumulate=False): + self.accumulator = [] + if accumulate: + self.write = self.accumulator.append + else: + self.write = self.safe_print_for_PHP + + def safe_print_for_PHP(self, s): + """ It seems that when called from PHP, Python is unable to guess correctly + the encoding of the standard output. """ + try: + print(s, file=sys.stdout) + except UnicodeEncodeError: + print(s.encode("utf8"), file=sys.stdout) class Common: @@ -23,12 +44,12 @@ def __init__(self, params): self.params = params def output_success_message(self, path): - return _('Output file "{filename}" successfully generated.').format(filename=path) + return _('Output file "{filename}" successfully generated.').format(filename=contract_path(path)) def update_source(self, source): path = Path(f"{self.params['output_name']}.mcd") path.write_text(source, encoding="utf8") - return _('Source file "{filename}" successfully updated.').format(filename=path) + return _('Source file "{filename}" successfully updated.').format(filename=contract_path(path)) def load_input_file(self): # Try to read the file locally. @@ -92,7 +113,3 @@ def ensure_margins_are_integer(shapes): style.update(shapes) style["transparent_color"] = None return style - - def dump_file(self, path, content): - Path(path).write_text(content, encoding="utf8") - safe_print_for_PHP(self.output_success_message(path)) diff --git a/mocodo/magic_command.py b/mocodo/magic_command.py index 9228a914..100a2e54 100644 --- a/mocodo/magic_command.py +++ b/mocodo/magic_command.py @@ -8,17 +8,12 @@ from base64 import b64encode from itertools import takewhile from pathlib import Path -from subprocess import PIPE, Popen -import pkg_resources from IPython import get_ipython -from IPython.core.magic import Magics, line_cell_magic, magics_class from IPython.display import HTML, SVG, Code, Image, Markdown, display -try: - MOCODO_VERSION = pkg_resources.get_distribution("mocodo").version -except pkg_resources.DistributionNotFound: - MOCODO_VERSION = "(unknown version)" # For tests during CI +from .__main__ import Printer, Runner +from .mocodo_error import MocodoError # ANSI color codes OK = "\033[92m" @@ -90,129 +85,112 @@ def display_converted_file(path, hide_header): else: display(Markdown(f"```{extension}\n{read_and_cleanup_text(path)}\n```")) -@magics_class -class MocodoMagics(Magics): - @staticmethod - @line_cell_magic - def mocodo(line, cell=""): - """ - Mocodo IPython magic extension - - Magic methods: - %mocodo [command line options] - %%mocodo [command line options] - < MCD ... > - - Usage: - %load_ext mocodo - """ - - parser = argparse.ArgumentParser(add_help=False) - parser.add_argument("--input", "-i") - parser.add_argument("--output_dir") - (args, remaining_args) = parser.parse_known_args(shlex.split(line)) - remaining_args = list(takewhile(lambda x: not x.startswith("#"), remaining_args)) - new_args = remaining_args[:] - - mocodo_notebook_dir = Path.cwd() - if mocodo_notebook_dir.name != "mocodo_notebook": - mocodo_notebook_dir = mocodo_notebook_dir / "mocodo_notebook" - mocodo_notebook_dir.mkdir(parents=True, exist_ok=True) - if not args.input: - input_path = mocodo_notebook_dir / "sandbox.mcd" - input_path.write_text(cell, encoding="utf8") - else: - input_path = Path(args.input) - if not input_path.suffix: - input_path = input_path.with_suffix(".mcd") - - if not args.output_dir: - output_dir = mocodo_notebook_dir - else: - output_dir = Path(args.output_dir) - output_dir.mkdir(parents=True, exist_ok=True) - output_path_radical = output_dir / input_path.stem - - remaining_args.extend([ - "--input", str(input_path), - "--output_dir", str(output_dir), - "--is_magic", - ]) # may override user's provided options - - process = Popen(["mocodo"] + remaining_args, stdin=PIPE, stdout=PIPE, stderr=PIPE) - stdoutdata, stderrdata = process.communicate() - try: - stdoutdata = stdoutdata.decode("utf8") - stderrdata = stderrdata.decode("utf8") - except: - pass - status = process.wait() - - if "--help" in remaining_args: - print(stdoutdata) - return - - if "--print_params" in remaining_args: - update_cell(PARAM_TEMPLATE.format(stdoutdata=stdoutdata, output_dir=output_dir.relative_to(Path.cwd()))) - return - - response_path = Path(f"{output_path_radical}_response_for_magic_command.json") - try: - response = json.loads(response_path.read_text(encoding="utf8")) - except (json.decoder.JSONDecodeError, FileNotFoundError): - response = {} - finally: - with contextlib.suppress(FileNotFoundError): # From Python 3.8, use the missing_ok argument - response_path.unlink() - - rewritten_source = response.get("rewritten_source", "") - redirect_output = response.get("redirect_output", False) - converted_file_paths = response.get("converted_file_paths", []) - - if status != 0 or stderrdata: - message = stderrdata - if rewritten_source: - message = f"{rewritten_source}\n\n{message}" - warnings.formatwarning = lambda x, *args, **kargs : str(x) - warnings.warn(message) - return - - if rewritten_source and not rewritten_source.startswith("%%mocodo"): - new_args = " ".join(filter(lambda x: x not in response["args_to_delete"], new_args)) - new_args = response["opt_to_restore"] + new_args - rewritten_source = f"%%mocodo{new_args}\n{rewritten_source}" - - for select in response.get("select", []): - if select == "mcd": - svg_path = output_path_radical.with_suffix(".svg") - if svg_path.is_file() and input_path.stat().st_mtime <= svg_path.stat().st_mtime: - display(SVG(filename=svg_path)) - elif select == "rw": - path = output_path_radical.with_suffix(".mcd") - display(Markdown(OUTPUT_PART_HEADER.format(label=path.relative_to(output_dir)))) - print(rewritten_source or cell) - elif select == "cv": - for converted_file_path in converted_file_paths: - display_converted_file(Path(converted_file_path), hide_header=response.get("mld")) - - if redirect_output: - if rewritten_source: - update_cell(rewritten_source) - if converted_file_paths: - # Copy the last converted file source to the clipboard - with contextlib.suppress(ImportError): - pyperclip = importlib.import_module("pyperclip") - converted_file_path = Path(converted_file_paths[-1]) - pyperclip.copy(converted_file_path.read_text(encoding="utf8")) - print(f'⧉ {OK}The contents of "{converted_file_path.relative_to(output_dir)}" has been copied to the clipboard.{RESET}') - - - - -try: - IPYTHON.register_magics(MocodoMagics) -except AttributeError: - pass # necessary for launching the tests -else: - print(f"Mocodo {MOCODO_VERSION} loaded.") +def mocodo(line, cell=""): + """ + Mocodo IPython magic extension + + Magic methods: + %mocodo [command line options] + %%mocodo [command line options] + < MCD ... > + + Usage: + %load_ext mocodo + """ + + parser = argparse.ArgumentParser(add_help=False) + parser.add_argument("--input", "-i") + parser.add_argument("--output_dir") + (args, remaining_args) = parser.parse_known_args(shlex.split(line)) + remaining_args = list(takewhile(lambda x: not x.startswith("#"), remaining_args)) + new_args = remaining_args[:] + + mocodo_notebook_dir = Path.cwd() + if mocodo_notebook_dir.name != "mocodo_notebook": + mocodo_notebook_dir = mocodo_notebook_dir / "mocodo_notebook" + mocodo_notebook_dir.mkdir(parents=True, exist_ok=True) + if not args.input: + input_path = mocodo_notebook_dir / "sandbox.mcd" + input_path.write_text(cell, encoding="utf8") + else: + input_path = Path(args.input) + if not input_path.suffix: + input_path = input_path.with_suffix(".mcd") + if not args.output_dir: + output_dir = mocodo_notebook_dir + else: + output_dir = Path(args.output_dir) + output_dir.mkdir(parents=True, exist_ok=True) + output_path_radical = output_dir / input_path.stem + + remaining_args.extend([ + "--input", str(input_path), + "--output_dir", str(output_dir), + "--is_magic", + ]) # may override user's provided options + + stdoutdata = "" + stderrdata = "" + printer = Printer(accumulate=True) + run = Runner(remaining_args, printer) + try: + stdoutdata = run() + except MocodoError as err: + stderrdata = str(err) + except SystemExit: # raised by argparse when --help is used + return + + if "--print_params" in remaining_args: + update_cell(PARAM_TEMPLATE.format(stdoutdata=stdoutdata, output_dir=output_dir.relative_to(Path.cwd()))) + return + + response_path = Path(f"{output_path_radical}_response_for_magic_command.json") + try: + response = json.loads(response_path.read_text(encoding="utf8")) + except (json.decoder.JSONDecodeError, FileNotFoundError): + response = {} + finally: + with contextlib.suppress(FileNotFoundError): # From Python 3.8, use the missing_ok argument + response_path.unlink() + + rewritten_source = response.get("rewritten_source", "") + redirect_output = response.get("redirect_output", False) + converted_file_paths = response.get("converted_file_paths", []) + + if stderrdata: + message = stderrdata + if rewritten_source: + message = f"{rewritten_source}\n\n{message}" + warnings.formatwarning = lambda x, *args, **kargs : str(x) + warnings.warn(message) + return + + if rewritten_source and not rewritten_source.startswith("%%mocodo"): + new_args = " ".join(filter(lambda x: x not in response["args_to_delete"], new_args)) + new_args = response["opt_to_restore"] + new_args + rewritten_source = f"%%mocodo{new_args}\n{rewritten_source}" + + for select in response.get("select", []): + if select == "mcd": + svg_path = output_path_radical.with_suffix(".svg") + if svg_path.is_file() and input_path.stat().st_mtime <= svg_path.stat().st_mtime: + display(SVG(filename=svg_path)) + elif select == "rw": + path = output_path_radical.with_suffix(".mcd") + display(Markdown(OUTPUT_PART_HEADER.format(label=path.relative_to(output_dir)))) + print(rewritten_source or cell) + elif select == "cv": + for converted_file_path in converted_file_paths: + display_converted_file(Path(converted_file_path), hide_header=response.get("mld")) + + if redirect_output: + if rewritten_source: + update_cell(rewritten_source) + if converted_file_paths: + # Copy the last converted file source to the clipboard + with contextlib.suppress(ImportError): + pyperclip = importlib.import_module("pyperclip") + converted_file_path = Path(converted_file_paths[-1]) + pyperclip.copy(converted_file_path.read_text(encoding="utf8")) + print(f'⧉ {OK}The contents of "{converted_file_path.relative_to(output_dir)}" has been copied to the clipboard.{RESET}') diff --git a/test/test_fitness.py b/test/test_fitness.py index b1dbeafd..5b91de9c 100755 --- a/test/test_fitness.py +++ b/test/test_fitness.py @@ -17,7 +17,7 @@ def test_optimal_layout(self): NIBH, 1N SCELERISQUE LOREM, 11 PELLENTESQUE IPSUM PELLENTESQUE IPSUM: tincidunt, bibendum, consequat, integer """ - params = parsed_arguments() + params = parsed_arguments([]) mcd = Mcd(source, params) params.update(mcd.get_layout_data()) d = mcd.get_layout_data() @@ -38,7 +38,7 @@ def test_optimal_layout_with_reflexive_association(self): Lappa: graffiti, champignon Puni, 11 Lappa, 0N Lappa """ - params = parsed_arguments() + params = parsed_arguments([]) mcd = Mcd(source, params) params.update(mcd.get_layout_data()) d = mcd.get_layout_data() @@ -56,7 +56,7 @@ def test_diagonal_reflexive_association(self): : Baby, 1N Norm, 0N> Norm """ - params = parsed_arguments() + params = parsed_arguments([]) mcd = Mcd(source, params) params.update(mcd.get_layout_data()) d = mcd.get_layout_data() @@ -73,7 +73,7 @@ def test_2_0_link(self): : COMMANDE: Num commande, Date, Montant """ - params = parsed_arguments() + params = parsed_arguments([]) mcd = Mcd(source, params) params.update(mcd.get_layout_data()) d = mcd.get_layout_data() @@ -91,7 +91,7 @@ def test_1_1_link(self): COMMANDE: Num commande, Date, Montant : """ - params = parsed_arguments() + params = parsed_arguments([]) mcd = Mcd(source, params) params.update(mcd.get_layout_data()) d = mcd.get_layout_data() @@ -111,7 +111,7 @@ def test_2_1_link(self): : : """ - params = parsed_arguments() + params = parsed_arguments([]) mcd = Mcd(source, params) params.update(mcd.get_layout_data()) d = mcd.get_layout_data() @@ -131,7 +131,7 @@ def test_k33(self): SODALES, 1N DIGNISSIM, 1N IMPERDIET, 1N TINCIDUNT QUIS ENIM, 1N DIGNISSIM, 1N IMPERDIET, 1N TINCIDUNT """ - params = parsed_arguments() + params = parsed_arguments([]) mcd = Mcd(source, params) params.update(mcd.get_layout_data()) d = mcd.get_layout_data() @@ -150,7 +150,7 @@ def test_k33_better(self): TINCIDUNT: faucibus, orci, cursus QUIS ENIM, 1N DIGNISSIM, 1N IMPERDIET, 1N TINCIDUNT """ - params = parsed_arguments() + params = parsed_arguments([]) mcd = Mcd(source, params) params.update(mcd.get_layout_data()) d = mcd.get_layout_data() diff --git a/test/test_mcd.py b/test/test_mcd.py index f74956ac..f6b059e4 100755 --- a/test/test_mcd.py +++ b/test/test_mcd.py @@ -8,7 +8,7 @@ gettext.NullTranslations().install() -params = parsed_arguments() +params = parsed_arguments([]) class McdTest(unittest.TestCase): diff --git a/test/test_mcd_dimensions.py b/test/test_mcd_dimensions.py index d9f85150..483130ec 100755 --- a/test/test_mcd_dimensions.py +++ b/test/test_mcd_dimensions.py @@ -7,7 +7,7 @@ gettext.NullTranslations().install() -params = parsed_arguments() +params = parsed_arguments([]) style = { "cartouche_text_height_ratio" : 0.85, diff --git a/test/test_relations.py b/test/test_relations.py index d09bf4c6..dd1a3085 100755 --- a/test/test_relations.py +++ b/test/test_relations.py @@ -11,7 +11,7 @@ minimal_template = load_mini_yaml(Path("mocodo/resources/relation_templates/text.yaml")) debug_template = load_mini_yaml(Path("mocodo/resources/relation_templates/debug.yaml")) -params = parsed_arguments() +params = parsed_arguments([]) params["title"] = "Untitled" params["guess_title"] = False diff --git a/test/test_zoo.py b/test/test_zoo.py index 160489ec..e7c822b4 100644 --- a/test/test_zoo.py +++ b/test/test_zoo.py @@ -88,7 +88,7 @@ def may_dump_rewritten_version(subfolder, source, stem, operation_name, subargs= continue templates.append(read_template(name, TEMPLATE_DIR)) - params = parsed_arguments() + params = parsed_arguments([]) params["guess_title"] = False params["id_gutter_visibility"] = "auto" params["id_gutter_strong_string"] = "ID" From 3ee82c31d8be9cd243d46dd3dc8f9a0cfc49ec71 Mon Sep 17 00:00:00 2001 From: Aristide Date: Mon, 15 Jan 2024 18:21:35 +0100 Subject: [PATCH 3/9] support calling mocodo as a importable function --- doc/fr_refman.html | 38613 ++++++++++++++++++++++++------------------ doc/fr_refman.ipynb | 1477 +- mocodo/call.py | 60 + 3 files changed, 22827 insertions(+), 17323 deletions(-) create mode 100644 mocodo/call.py diff --git a/doc/fr_refman.html b/doc/fr_refman.html index 0ac2507e..386d1264 100644 --- a/doc/fr_refman.html +++ b/doc/fr_refman.html @@ -1,11249 +1,12625 @@ - +None + -fr_refman +fr_refman - - + + + + + + + + - +body[data-format='mobile'] .jp-OutputArea-child .jp-OutputArea-output { + display: table-row; +} - - - - - - + @@ -13080,45 +14576,71 @@ - + - + - -
-
- -
-
-
In [37]:
-
-
+ + + + +