-
Notifications
You must be signed in to change notification settings - Fork 17
Clarify code indents #2
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
Conversation
When I started using this library I copied and pasted the code in the README into the CircuitPython REPL but got stuck because the `print` statement didn't appear to be indented in the code block. I've added four spaces to the appropriate lines to make this clearer.
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.
Thanks! This is clearer with four spaces.
README.rst
Outdated
|
||
Finally, read the temperature property. | ||
|
||
.. code-block:: python | ||
|
||
# and print it out | ||
print(t.temperature) | ||
# and print it out |
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.
Please indent this too. It should match the code around it.
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.
Hmm. Adding four spaces to the comment seems to cause the code block to ignore the spaces in both lines. Please ignore the amended pull request for now and let me look into how to fix that.
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.
Oh weird! Maybe the blocks should just be merged together? Thanks for figuring this out!
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.
I think that would be the simplest solution. A quick web search shows that this is something people have run into before and there doesn't appear to be an elegant solution. reST gobbles spaces when all lines have the same indent. I'll amend the pull request.
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.
Looks good! Thanks!
Updating https://github.com/adafruit/Adafruit_CircuitPython_ADS1x15 to 0.1.0 from e731810: > fix .travis.yml > add .travis.yml and .gitignore; I2C.read_into -> readinto Updating https://github.com/adafruit/Adafruit_CircuitPython_BME280 to 2.0 from 1.0.0: > Update travis config to use 2.x branch for MPY generation. > changed read_into to readinto > Merge pull request adafruit/Adafruit_CircuitPython_BME280#1 from chickadee-tech/doc_fix Updating https://github.com/adafruit/Adafruit_CircuitPython_BME680 to 2.0.1 from f1e5aa2: > Ensure gas property updates reading state. > rename fix > Update travis config with 2.x branch MPY generation. > changed read_into to readinto > Merge pull request adafruit/Adafruit_CircuitPython_BME680#1 from chickadee-tech/doc_fix Updating https://github.com/adafruit/Adafruit_CircuitPython_BMP280 to 2.0 from 1.0.0: > Update travis to use 2.x branch for MPY generation. > changed read_into to readinto > Merge pull request adafruit/Adafruit_CircuitPython_BMP280#2 from chickadee-tech/doc_fix Updating https://github.com/adafruit/Adafruit_CircuitPython_BNO055 to 2.0 from 0.1.3: > Switch to 2.x branch for MPY generation. > changed read_into to readinto Updating https://github.com/adafruit/Adafruit_CircuitPython_CCS811 to 0.0.2 from 0.0.1: > changed read_into to readinto Updating https://github.com/adafruit/Adafruit_CircuitPython_DS3231 to 2.0.1 from 1.0.0: > changed read_into to readinto > Add demo example based on PCF8523 guide. > Switch to build from circuitpython 2.x branch mpy-cross Updating https://github.com/adafruit/Adafruit_CircuitPython_LIS3DH to 0.1.3 from 0.1.2: > busdevice method changed from read_into() to readinto() > Optimize the way data in unpacked (adafruit/Adafruit_CircuitPython_LIS3DH#9) > added ImportError to except > changed to use struct module instead of ustruct (adafruit/Adafruit_CircuitPython_LIS3DH#6) > Update to upcoming NeoPixel API Updating https://github.com/adafruit/Adafruit_CircuitPython_MAX31855 to 2.0 from 0.1.1: > Update .travis.yml > changed conditional import for struct and ustruct (adafruit/Adafruit_CircuitPython_MAX31855#2) Updating https://github.com/adafruit/Adafruit_CircuitPython_MCP9808 to 2.0 from 0.1.1: > Update .travis.yml > changed read_into to readinto > Clarify code indents (adafruit/Adafruit_CircuitPython_MCP9808#2) > Minor tidying Updating https://github.com/adafruit/Adafruit_CircuitPython_MPR121 to 0.1.2 from 0.1.1: > changed read_into to readinto Updating https://github.com/adafruit/Adafruit_CircuitPython_PCF8523 to 0.1.1 from 0.1.0: > changed read_into to readinto Updating https://github.com/adafruit/Adafruit_CircuitPython_SI7021 to 2.0 from 0.1.4: > Switch travis config to build from 2.0 circuitpython branch. > changed read_into to readinto Updating https://github.com/adafruit/Adafruit_CircuitPython_TSL2561 to 2.0 from 51b7cd9: > Update travis config to use 2.x branch for MPY generation. > Merge pull request adafruit/Adafruit_CircuitPython_TSL2561#6 from caternuson/master > fix deploy filename > Correct the docs badge > Merge pull request adafruit/Adafruit_CircuitPython_TSL2561#3 from caternuson/master > Merge pull request adafruit/Adafruit_CircuitPython_TSL2561#2 from caternuson/iss001 Updating https://github.com/adafruit/Adafruit_CircuitPython_VC0706 to 2.0 from 286bd31: < Add example with internal filesystem write. Updating https://github.com/adafruit/Adafruit_CircuitPython_BusDevice to 2.0.1 from 0.3.1: > remove deprecated method read_into > Added readinto() method to be more consistant with busdevice.spi. (adafruit/Adafruit_CircuitPython_BusDevice#10) Updating https://github.com/adafruit/Adafruit_CircuitPython_Register to 1.0.3 from 1.0.2: > changed read_into to readinto to follow changes in Adafruit_CircuitPython_BusDevice (adafruit/Adafruit_CircuitPython_Register#6)
Updating https://github.com/adafruit/Adafruit_CircuitPython_ADS1x15 to 0.1.0 from e731810: > fix .travis.yml > add .travis.yml and .gitignore; I2C.read_into -> readinto Updating https://github.com/adafruit/Adafruit_CircuitPython_BME280 to 2.0 from 1.0.0: > Update travis config to use 2.x branch for MPY generation. > changed read_into to readinto > Merge pull request adafruit/Adafruit_CircuitPython_BME280#1 from chickadee-tech/doc_fix Updating https://github.com/adafruit/Adafruit_CircuitPython_BME680 to 2.0.1 from f1e5aa2: > Ensure gas property updates reading state. > rename fix > Update travis config with 2.x branch MPY generation. > changed read_into to readinto > Merge pull request adafruit/Adafruit_CircuitPython_BME680#1 from chickadee-tech/doc_fix Updating https://github.com/adafruit/Adafruit_CircuitPython_BMP280 to 2.0 from 1.0.0: > Update travis to use 2.x branch for MPY generation. > changed read_into to readinto > Merge pull request adafruit/Adafruit_CircuitPython_BMP280#2 from chickadee-tech/doc_fix Updating https://github.com/adafruit/Adafruit_CircuitPython_BNO055 to 2.0 from 0.1.3: > Switch to 2.x branch for MPY generation. > changed read_into to readinto Updating https://github.com/adafruit/Adafruit_CircuitPython_CCS811 to 0.0.2 from 0.0.1: > changed read_into to readinto Updating https://github.com/adafruit/Adafruit_CircuitPython_DS3231 to 2.0.1 from 1.0.0: > changed read_into to readinto > Add demo example based on PCF8523 guide. > Switch to build from circuitpython 2.x branch mpy-cross Updating https://github.com/adafruit/Adafruit_CircuitPython_LIS3DH to 0.1.3 from 0.1.2: > busdevice method changed from read_into() to readinto() > Optimize the way data in unpacked (adafruit/Adafruit_CircuitPython_LIS3DH#9) > added ImportError to except > changed to use struct module instead of ustruct (adafruit/Adafruit_CircuitPython_LIS3DH#6) > Update to upcoming NeoPixel API Updating https://github.com/adafruit/Adafruit_CircuitPython_MAX31855 to 2.0 from 0.1.1: > Update .travis.yml > changed conditional import for struct and ustruct (adafruit/Adafruit_CircuitPython_MAX31855#2) Updating https://github.com/adafruit/Adafruit_CircuitPython_MCP9808 to 2.0 from 0.1.1: > Update .travis.yml > changed read_into to readinto > Clarify code indents (adafruit/Adafruit_CircuitPython_MCP9808#2) > Minor tidying Updating https://github.com/adafruit/Adafruit_CircuitPython_MPR121 to 0.1.2 from 0.1.1: > changed read_into to readinto Updating https://github.com/adafruit/Adafruit_CircuitPython_PCF8523 to 0.1.1 from 0.1.0: > changed read_into to readinto Updating https://github.com/adafruit/Adafruit_CircuitPython_SI7021 to 2.0 from 0.1.4: > Switch travis config to build from 2.0 circuitpython branch. > changed read_into to readinto Updating https://github.com/adafruit/Adafruit_CircuitPython_TSL2561 to 2.0 from 51b7cd9: > Update travis config to use 2.x branch for MPY generation. > Merge pull request adafruit/Adafruit_CircuitPython_TSL2561#6 from caternuson/master > fix deploy filename > Correct the docs badge > Merge pull request adafruit/Adafruit_CircuitPython_TSL2561#3 from caternuson/master > Merge pull request adafruit/Adafruit_CircuitPython_TSL2561#2 from caternuson/iss001 Updating https://github.com/adafruit/Adafruit_CircuitPython_VC0706 to 2.0 from 286bd31: < Add example with internal filesystem write. Updating https://github.com/adafruit/Adafruit_CircuitPython_BusDevice to 2.0.1 from 0.3.1: > remove deprecated method read_into > Added readinto() method to be more consistant with busdevice.spi. (adafruit/Adafruit_CircuitPython_BusDevice#10) Updating https://github.com/adafruit/Adafruit_CircuitPython_Register to 1.0.3 from 1.0.2: > changed read_into to readinto to follow changes in Adafruit_CircuitPython_BusDevice (adafruit/Adafruit_CircuitPython_Register#6)
When I started using this library I copied and pasted the code in the README into the CircuitPython REPL but got stuck because the
print
statement didn't appear to be indented in the code block. I've added four spaces to the appropriate lines to make this clearer.