Hi gurus,
I have suffered for a long time because I have quite a lot of fixes and I can hardly find my way in this jungle and keep a logical order and find old ones. So I decided to write a script that creates a table of contents int fixes.py/user-fixes.py.
Then I thought it should also list main-level variables and functions (Python is very good at dissolving main-level things from others :-)). As I already wrote earlier, I use several own functions for my fixes ([1]). And also header lines of some predefined format. All this script needs a place to insert the TOC which should be a predefined constant line, e.g. # *** CONTENTS *** # (If the script finds the corresponding END CONTENTS line, it clears the previous TOC from between these two.)
But then I realized that enhanced with classes this would be useful for any kind of scripts without extra work. For example in wikipedia.py which is now long, long, and hard to overview. Of course, there would be a possibility to leave some kind of data (e.g. "no variables please, only functiions and classes"), and two approaches for ordering (everything in original order, or fisrt the variables, then functions, then fixes...). Unfortunately, in some rare cases the length of a line may excced the 80 characters, which may cause PEP8 and/or Xqt beiing sad. :-)
How does this concept sound?
I will anyhow write it for my own purposes. It is just about community use for complicated scripts such as fixes.py or wikipedia.py.
[1] http://hu.wikipedia.org/wiki/Szerkeszt%C5%91:Bin%C3%A1ris/Fixes_and_function...
Hi Bináris,
Any documentation work always makes me happy :-) I don't completely understand your proposal however - would the script generate a page like [1] for wikipedia.py?
Merlijn
[1] http://hu.wikipedia.org/wiki/Szerkeszt%C5%91:Bin%C3%A1ris/Fixes_and_function...
On 13 March 2013 11:38, Bináris wikiposta@gmail.com wrote:
Hi gurus,
I have suffered for a long time because I have quite a lot of fixes and I can hardly find my way in this jungle and keep a logical order and find old ones. So I decided to write a script that creates a table of contents int fixes.py/user-fixes.py.
Then I thought it should also list main-level variables and functions (Python is very good at dissolving main-level things from others :-)). As I already wrote earlier, I use several own functions for my fixes ([1]). And also header lines of some predefined format. All this script needs a place to insert the TOC which should be a predefined constant line, e.g. # *** CONTENTS *** # (If the script finds the corresponding END CONTENTS line, it clears the previous TOC from between these two.)
But then I realized that enhanced with classes this would be useful for any kind of scripts without extra work. For example in wikipedia.py which is now long, long, and hard to overview. Of course, there would be a possibility to leave some kind of data (e.g. "no variables please, only functiions and classes"), and two approaches for ordering (everything in original order, or fisrt the variables, then functions, then fixes...). Unfortunately, in some rare cases the length of a line may excced the 80 characters, which may cause PEP8 and/or Xqt beiing sad. :-)
How does this concept sound?
I will anyhow write it for my own purposes. It is just about community use for complicated scripts such as fixes.py or wikipedia.py.
[1] http://hu.wikipedia.org/wiki/Szerkeszt%C5%91:Bin%C3%A1ris/Fixes_and_function... -- Bináris _______________________________________________ Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
2013/4/13 Merlijn van Deen valhallasw@arctus.nl
Hi Bináris,
Any documentation work always makes me happy :-) I don't completely understand your proposal however - would the script generate a page like [1] for wikipedia.py?
No, I mean an automatic inner table of contents somewhere at the beginning of a file. It needs some predefined placeholders and optional header lines, and will show the functions, classes etc. of a script together with their line numbers. Of course, the TOC script has to calculate the length of TOC and new line numbers first as it shifts everything. Unfortunately, this script has to be run after every modification to be up-to-date. I will show an example when I am ready.