Skip to content

Sound internal tables made private - #308

Merged
ddemidov merged 2 commits into
ev3dev:developfrom
EricPobot:private_sound_constants
Feb 18, 2017
Merged

ddemidov merged 2 commits into
ev3dev:developfrom
EricPobot:private_sound_constants

Conversation

@EricPobot

Copy link
Copy Markdown
Contributor

Generated documentation checked for Sound internal tables not been included any more.

Some documentation update included too.

@EricPobot

Copy link
Copy Markdown
Contributor Author

Side note: how do you generate the documentation ?

I had to follow the suggestion made here to be able to run the process, since sphinx-build refers to Python2 interpreter in its shebang, and ev3dev packages being Python3, the process hangs when importing them. The Makefile must be updated then for using the sphinx-build Py3 version.

I have added the sphinx3-build script and the modified Makefile in my local branch but have not pushed them yet, in case it would have interfered with the current project usages.

Comment thread ev3dev/core.py Outdated

Accepted note symbols and values are defined by the :py:attr:`NOTES` and :py:attr:`NOTE_VALUES`
dictionaries. The value can be suffixed by modifiers:
For an exhaustive liste of accepted note symbols and values, have a look at the :py:attr:`_NOTE_FREQUENCIES`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: 'liste'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. Fixed.

@ddemidov

ddemidov commented Feb 18, 2017 •

Copy link
Copy Markdown
Member

Side note: how do you generate the documentation ?

I don't. readthedocs.com picks up new commits and rebuilds the documentation there. The documentation for the latest commit in develop branch is here: http://python-ev3dev.readthedocs.io/en/develop/.

But the following should work if you need to build a local copy:

cd docs
make html

It needs some python packages to be installed, one that I remember of is sphinx-bootstrap-theme.

@ddemidov

Copy link
Copy Markdown
Member

I may be in slight advantage, since /usr/bin/python on Arch linux is python3.

@ddemidov
ddemidov merged commit 770ae2a into ev3dev:develop Feb 18, 2017
@ddemidov

Copy link
Copy Markdown
Member

Thanks!

@ddemidov

Copy link
Copy Markdown
Member

And readthedocs.com picked this already: http://python-ev3dev.readthedocs.io/en/develop/other.html#sound

@EricPobot

Copy link
Copy Markdown
Contributor Author

I may be in slight advantage, since /usr/bin/python on Arch linux is python3.

This makes de difference :)

And readthedocs.com picked this already

Perfect.

However, if contributors want to check their documentation before publishing (what I did) they will run into the problem. Do you think that the workaround I've used worth being included in the sources ?

@EricPobot
EricPobot deleted the private_sound_constants branch February 18, 2017 13:23
@ddemidov

Copy link
Copy Markdown
Member

If the workaround works for all cases, then sure.

@EricPobot

Copy link
Copy Markdown
Contributor Author

It works for me (Mint 17.3 with Py2 as default). But I can't say for the readthedoc chain or other contexts.

Basically, it consists in modifying this line at the beginning of the Makefile :

SPHINXBUILD = ./sphinx3-build

And creating the corresponding script like this :

#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Same as /usr/bin/sphinx-build but with different
interpreter
 
Source: http://stackoverflow.com/a/24675806
"""
import sys
 
if __name__ == '__main__':
    from sphinx import main, make_main
    if sys.argv[1:2] == ['-M']:
         sys.exit(make_main(sys.argv))
    else:
        sys.exit(main(sys.argv))

@ddemidov

Copy link
Copy Markdown
Member

readthedocs.org do not use the Makefile, the only thing that matters for them is conf.py.

It looks like the workaround may work for the case when python3 is the default one. I can test this if you make the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants