Skip to content
This repository has been archived by the owner on Jun 7, 2021. It is now read-only.

Can't create documentation with Sphinx due to error #5

Open
bee-san opened this issue Jun 4, 2020 · 7 comments
Open

Can't create documentation with Sphinx due to error #5

bee-san opened this issue Jun 4, 2020 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@bee-san
Copy link
Member

bee-san commented Jun 4, 2020

/home/bee/Documents/Ciphey/docs/index.rst:20: WARNING: image file not readable: cipheyWorking.gif
/home/bee/Documents/Ciphey/ciphey/__main__.py:docstring of ciphey.__main__:1: WARNING: Error in "py:module" directive:
no content permitted.

.. py:module:: ciphey.__main__

 ██████╗██╗██████╗ ██╗  ██╗███████╗██╗   ██╗
/home/bee/Documents/Ciphey/ciphey/__main__.py:docstring of ciphey.__main__:2: WARNING: Explicit markup ends without a blank line; unexpected unindent.
/home/bee/Documents/Ciphey/ciphey/__main__.py:docstring of ciphey.__main__.call_encryption:3: WARNING: Unexpected indentation.
/home/bee/Documents/Ciphey/ciphey/__main__.py:docstring of ciphey.__main__.main:3: WARNING: Inline strong start-string without end-string.
/home/bee/Documents/Ciphey/ciphey/languageCheckerMod/LanguageChecker.py:docstring of ciphey.languageCheckerMod.LanguageChecker:1: WARNING: Error in "py:module" directive:
no content permitted.

.. py:module:: ciphey.languageCheckerMod.LanguageChecker

 ██████╗██╗██████╗ ██╗  ██╗███████╗██╗   ██╗
/home/bee/Documents/Ciphey/ciphey/languageCheckerMod/LanguageChecker.py:docstring of ciphey.languageCheckerMod.LanguageChecker:2: WARNING: Explicit markup ends without a blank line; unexpected unindent.
/home/bee/Documents/Ciphey/ciphey/languageCheckerMod/LanguageChecker.py:docstring of ciphey.languageCheckerMod.LanguageChecker:12: WARNING: Unexpected indentation.
/home/bee/Documents/Ciphey/ciphey/languageCheckerMod/LanguageChecker.py:docstring of ciphey.languageCheckerMod.LanguageChecker:16: WARNING: Unexpected indentation.
/home/bee/Documents/Ciphey/ciphey/languageCheckerMod/LanguageChecker.py:docstring of ciphey.languageCheckerMod.LanguageChecker:19: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/bee/Documents/Ciphey/ciphey/languageCheckerMod/LanguageChecker.py:docstring of ciphey.languageCheckerMod.LanguageChecker:22: WARNING: Unexpected indentation.
/home/bee/Documents/Ciphey/ciphey/languageCheckerMod/LanguageChecker.py:docstring of ciphey.languageCheckerMod.LanguageChecker:31: WARNING: Unexpected indentation.
/home/bee/Documents/Ciphey/ciphey/languageCheckerMod/LanguageChecker.py:docstring of ciphey.languageCheckerMod.LanguageChecker:32: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/bee/Documents/Ciphey/ciphey/languageCheckerMod/LanguageChecker.py:docstring of ciphey.languageCheckerMod.LanguageChecker:36: WARNING: Unexpected indentation.
/home/bee/Documents/Ciphey/ciphey/languageCheckerMod/LanguageChecker.py:docstring of ciphey.languageCheckerMod.LanguageChecker:39: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/bee/Documents/Ciphey/ciphey/languageCheckerMod/LanguageChecker.py:docstring of ciphey.languageCheckerMod.LanguageChecker:43: WARNING: Unexpected indentation.
/home/bee/Documents/Ciphey/ciphey/languageCheckerMod/LanguageChecker.py:docstring of ciphey.languageCheckerMod.LanguageChecker:47: WARNING: Block quote ends without a blank line; unexpected unindent.
@bee-san bee-san self-assigned this Jun 4, 2020
@bee-san
Copy link
Member Author

bee-san commented Jun 4, 2020

"""
 ██████╗██╗██████╗ ██╗  ██╗███████╗██╗   ██╗
██╔════╝██║██╔══██╗██║  ██║██╔════╝╚██╗ ██╔╝
██║     ██║██████╔╝███████║█████╗   ╚████╔╝ 
██║     ██║██╔═══╝ ██╔══██║██╔══╝    ╚██╔╝  
╚██████╗██║██║     ██║  ██║███████╗   ██║ 
© Brandon Skerritt
https://github.com/brandonskerritt/ciphey

The cycle goes:
main -> argparsing (if needed) -> call_encryption -> new Ciphey object -> decrypt() -> produceProbTable ->
one_level_of_decryption -> decrypt_normal

Ciphey can be called 3 ways:
echo 'text' | ciphey
ciphey 'text'
ciphey -t 'text'
main captures the first 2
argparsing captures the last one (-t)
it sends this to call_encryption, which can handle all 3 arguments using dict unpacking

decrypt() creates the prob table and prints it.

one_level_of_decryption() allows us to repeatedly call one_level_of_decryption on the inputs
so if something is doubly encrypted, we can use this to find it.

Decrypt_normal is one round of decryption. We need one_level_of_decryption to call it, as
one_level_of_decryption handles progress bars and stuff.
"""

@bee-san
Copy link
Member Author

bee-san commented Jun 4, 2020

 ██████╗██╗██████╗ ██╗  ██╗███████╗██╗   ██╗
██╔════╝██║██╔══██╗██║  ██║██╔════╝╚██╗ ██╔╝
██║     ██║██████╔╝███████║█████╗   ╚████╔╝ 
██║     ██║██╔═══╝ ██╔══██║██╔══╝    ╚██╔╝  
╚██████╗██║██║     ██║  ██║███████╗   ██║ 
© Brandon Skerritt
Github: brandonskerritt

Class to determine whether somethine is English or not.
1. Calculate the Chi Squared score of a sentence
2. If the score is significantly lower than the average score, it _might_ be English
    2.1. If the score _might_ be English, then take the text and compare it to the sorted dictionary
    in O(n log n) time.
    It creates a percentage of "How much of this text is in the dictionary?"
    The dictionary contains:
        * 20,000 most common US words
        * 10,000 most common UK words (there's no repition between the two)
        * The top 10,000 passwords
    If the word "Looks like" English (chi-squared) and if it contains English words, we can conclude it is
    very likely English. The alternative is doing the dictionary thing but with an entire 479k word dictionary (slower)
    2.2. If the score is not English, but we haven't tested enough to create an average, then test it against
     the dictionary

Things to optimise:
* We only run the dictionary if it's 20% smaller than the average for chi squared
* We consider it "English" if 45% of the text matches the dictionary
* We run the dictionary if there is less than 10 total chisquared test

How to add a language:
* Download your desired dictionary. Try to make it the most popular words, for example. Place this file into this
 folder with languagename.txt
As an example, this comes built in with english.txt
Find the statistical frequency of each letter in that language. 
For English, we have:
self.languages = {
    "English":
    [0.0855, 0.0160, 0.0316, 0.0387, 0.1210,0.0218, 0.0209, 0.0496, 0.0733, 0.0022,0.0081, 0.0421, 0.0253, 0.0717,
    0.0747,0.0207, 0.0010, 0.0633, 0.0673, 0.0894,0.0268, 0.0106, 0.0183, 0.0019, 0.0172,0.0011]
}
In chisquared.py
To add your language, do:
self.languages = {
    "English":
    [0.0855, 0.0160, 0.0316, 0.0387, 0.1210,0.0218, 0.0209, 0.0496, 0.0733, 0.0022,0.0081, 0.0421, 0.0253, 0.0717,
    0.0747,0.0207, 0.0010, 0.0633, 0.0673, 0.0894,0.0268, 0.0106, 0.0183, 0.0019, 0.0172,0.0011]
    "German": [0.0973]
}   
In alphabetical order
And you're.... Done! Make sure the name of the two match up
"""

@bee-san
Copy link
Member Author

bee-san commented Jun 4, 2020

Readthedocs cannot find module ciphey on the website, but locally it can find it just fine:

No module named 'ciphey'
WARNING: autodoc: failed to import module 'mathsHelper' from module 'ciphey'; the following exception was raised:
No module named 'ciphey'
WARNING: autodoc: failed to import module 'languageCheckerMod.LanguageChecker' from module 'ciphey'; the following exception was raised:
No module named 'ciphey'
WARNING: autodoc: failed to import module 'neuralNetworkMod.nn' from module 'ciphey'; the following exception was raised:
No module named 'ciphey'
looking for now-outdated files... none found```

@bee-san
Copy link
Member Author

bee-san commented Jul 6, 2020

This is still an issue, when in /docs run make html to see the errors.

/home/bee/Documents/Ciphey/ciphey/__main__.py:docstring of ciphey.__main__:1: WARNING: Error in "py:module" directive:
no content permitted.

.. py:module:: ciphey.__main__

 ██████╗██╗██████╗ ██╗  ██╗███████╗██╗   ██╗
/home/bee/Documents/Ciphey/ciphey/__main__.py:docstring of ciphey.__main__:2: WARNING: Explicit markup ends without a blank line; unexpected unindent.
WARNING: autodoc: failed to import module 'languageCheckerMod.LanguageChecker' from module 'ciphey'; the following exception was raised:
No module named 'ciphey.languageCheckerMod'
WARNING: autodoc: failed to import module 'nn' from module 'ciphey.neuralNetworkMod'; the following exception was raised:
No module named 'ciphey.neuralNetworkMod.nn'

@Cyclic3
Copy link
Member

Cyclic3 commented Jul 8, 2020

This is an issue for CipheyDocs, and I cannot repro

@Cyclic3 Cyclic3 closed this as completed Jul 8, 2020
@bee-san
Copy link
Member Author

bee-san commented Jul 10, 2020

I cannot get this to work.

Steps to repro:
https://docs.ciphey.online/en/latest/py-modindex.html

There is no docstrings. It is caused by the fact that Read The Docs cannot easily import Ciphey. When done locally, it works fine. Would be nice to find a way to tell Read The Docs to use the local version of the generated HTML only.

@bee-san bee-san reopened this Jul 10, 2020
@bee-san bee-san transferred this issue from Ciphey/Ciphey Jul 10, 2020
@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.94. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@issue-label-bot issue-label-bot bot added the bug Something isn't working label Jul 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants