コード例 #1
0
ファイル: LilyPondCommand.py プロジェクト: adorsk/abjad
 def _lilypond_format(self):
     from abjad.tools import stringtools
     command = self._name
     if command.startswith('#'):
         return command
     else:
         return '\\' + stringtools.snake_case_to_lower_camel_case(command)
コード例 #2
0
    def __str__(self):
        r'''Gets string format of LilyPond comment.

        Returns string.
        '''
        from abjad.tools import stringtools
        command = stringtools.snake_case_to_lower_camel_case(
            self.contents_string)
        return r'%% %s' % command
コード例 #3
0
ファイル: LilyPondComment.py プロジェクト: Alwnikrotikz/abjad
    def lilypond_format(self):
        r'''LilyPond input format of comment:

        ::

            >>> comment = marktools.LilyPondComment('this is a comment.')
            >>> comment.lilypond_format
            '% this is a comment.'

        Returns string.
        '''
        from abjad.tools import stringtools
        command = stringtools.snake_case_to_lower_camel_case(
            self.contents_string)
        return r'%% %s' % command
コード例 #4
0
    def lilypond_format(self):
        r'''LilyPond input format of LilyPond command mark:

        ::

            >>> note = Note("c'4")
            >>> command = marktools.LilyPondCommandMark('slurDotted')
            >>> command = attach(command, note)
            >>> command.lilypond_format
            '\\slurDotted'

        Returns string.
        '''
        from abjad.tools import stringtools
        command = self._command_name
        if command.startswith('#'):
            return command
        else:
            return '\\' + stringtools.snake_case_to_lower_camel_case(command)
コード例 #5
0
ファイル: LilyPondComment.py プロジェクト: adorsk/abjad
 def _lilypond_format(self):
     from abjad.tools import stringtools
     command = stringtools.snake_case_to_lower_camel_case(
         self.contents_string)
     return r'%% %s' % command