Skip to content
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

Merged
merged 10 commits into from Nov 13, 2015
Merged

New file extensions #174

merged 10 commits into from Nov 13, 2015

Conversation

oliverpool
Copy link
Contributor

Fix #114

Patadata devra être mis à jour (ou pas, cf 7ee1776)

@@ -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
Copy link
Contributor Author

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...

Copy link
Contributor

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
Copy link
Contributor Author

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."
Copy link
Contributor

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.
Copy link
Contributor

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`.
Copy link
Contributor

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

@paternal
Copy link
Contributor

Désolé : Je ne fais pas les modif' moi-même car je ne suis pas chez moi.

@oliverpool
Copy link
Contributor Author

Désolé : Je ne fais pas les modif' moi-même car je ne suis pas chez moi.

Pas de soucis, j'ai fait les modifs demandées !

J'ai rajouté une compatibilité avec les fichiers .sg: 7ee1776

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 .tsg)

paternal added a commit that referenced this pull request Nov 13, 2015
@paternal paternal merged commit 9b1b94c into master Nov 13, 2015
@paternal paternal deleted the new_extensions branch November 13, 2015 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants