New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New file extensions #174
New file extensions #174
Conversation
@@ -153,7 +153,7 @@ def main(): | |||
# Command line options | |||
datadirs += [item[0] for item in options.datadir] | |||
if 'datadir' in songbook: | |||
# .sg file | |||
# .tsg file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je ne suis pas bien sûr de bien comprendre ce qui ce passe ici...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ce commentaire est inutile.
Dans ce if
, on regarde si une option datadir
est définie dans le fichier de configuration. Si c'est le cas, on l'analyse et on l'ajoute aux datadirs. Donc rien de spécifique aux extensions de fichiers ici (sauf la suppression du commentaire inutile).
|
||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
%% songs/./datadir.sgc | ||
%% songs/./datadir.csg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Les chants sont à des nouvelles positions, car les nouvelles extensions n'ont plus le même ordre lexicographique ^^
@@ -33,7 +33,7 @@ def parse(keyword, argument, contentlist, config): | |||
""" | |||
if not contentlist: | |||
LOGGER.warning( | |||
"Useless 'tex' content: list of files to include is empty." | |||
"Useless 'tsg' content: list of files to include is empty." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ce fichier concerne l'inclusion de fichiers latex bruts (pas de chansons). Donc il faut laisser l'extension tex
.
|
||
class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): | ||
"""Test of chorpro parser, and several renderers. | ||
|
||
For any given `foo.source`, it is parsed as a chordpro file, and should be | ||
rendered as `foo.sgc` with the chordpro renderer, and `foo.tex` with the | ||
rendered as `foo.csg` with the chordpro renderer, and `foo.tsg` with the | ||
latex renderer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On peut ajouter and so on
pour dire qu'on vérifie aussi la conversion vers du HTML, et vers n'importe quel format qui sera ajouté plus tard…
def assertRender(self, base, destformat): # pylint: disable=invalid-name | ||
"""Assert that `{base}.source` is correctly rendered in the `destformat`. | ||
def assertRender(self, base, in_format, out_format): # pylint: disable=invalid-name | ||
"""Assert that `{base}.source` is correctly rendered in the `out_format`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{base}.source
=> {base}.{in_format}.source
Désolé : Je ne fais pas les modif' moi-même car je ne suis pas chez moi. |
3e2ff83
to
9d74a41
Compare
Pas de soucis, j'ai fait les modifs demandées ! J'ai rajouté une compatibilité avec les fichiers C'est peu couteux (1 ligne de code) et ça évite d'être backward incompatible (mais désormais l'extension "officielle" pour les chants LaTeX est |
Fix #114
Patadata devra être mis à jour (ou pas, cf 7ee1776)