Converting Python Scripts to meet PEP-8 (and bugs)
Re: Converting Python Scripts to meet PEP-8
I will peruse the docs on how to set up a local repository and connect it to the main one. I may scream for help at some point. Just be aware that I have not tested everything to death yet. (So much to learn... my aged brain resists..)
EDIT: OK, now I'm dangerous:
I set up a GitHub repository on my system and cloned moul-scripts and created a local repository called moul-scripts-pep8.
What would be the best way (preferable to you) to proceed? Should I (or someone ) create a moul-scripts-pep8 repository up in H-uru and work in a clone locally or some other procedure. I don't want to walk all over the way you do things. I'm still a bit unsure about how to do things with a repository system.
EDIT: OK, now I'm dangerous:
I set up a GitHub repository on my system and cloned moul-scripts and created a local repository called moul-scripts-pep8.
What would be the best way (preferable to you) to proceed? Should I (or someone ) create a moul-scripts-pep8 repository up in H-uru and work in a clone locally or some other procedure. I don't want to walk all over the way you do things. I'm still a bit unsure about how to do things with a repository system.
- Lyrositor
- Director of Wiki Operations
- Posts: 208
- Joined: Tue Feb 07, 2012 6:05 pm
- MOULa KI#: 6940115
- Contact:
Re: Converting Python Scripts to meet PEP-8
I think you're overcomplicating things here.
Here's a step-by-step guide:
1. Go to the H'uru moul-scripts repository while logged in and click the "Fork" button. This will create a copy of moul-scripts in your Github account.
2. On your computer, type into your Git console "git clone https://github.com/YOUR_USERNAME/moul-scripts", replacing YOUR_USERNAME with your Github username. You can also find this URL in your moul-scripts repository on Github, to the right of your file list ("HTTPS clone URL").
3. Once the repository is cloned, type "cd moul-scripts" to go into the moul-scripts folder, then type "git checkout -b pep8"; this creates a new branch called pep8 and switches to it.
4. Now write all your changes to the files.
5. Then type "git commit -a" and enter a message when prompted.
6. Type "git push -u origin pep8" to push your changes to your moul-scripts repo; enter your username and password when prompted.
7. Finally, go to your Github moul-scripts repo, check your changes were added to the pep8 branch by selecting that branch, then, when you're confident everything is as it should be, click on the "Pull Requests" link and select "New pull request". Add a title for your pull request, a message detailing it, then send it for review. You're done!

1. Go to the H'uru moul-scripts repository while logged in and click the "Fork" button. This will create a copy of moul-scripts in your Github account.
2. On your computer, type into your Git console "git clone https://github.com/YOUR_USERNAME/moul-scripts", replacing YOUR_USERNAME with your Github username. You can also find this URL in your moul-scripts repository on Github, to the right of your file list ("HTTPS clone URL").
3. Once the repository is cloned, type "cd moul-scripts" to go into the moul-scripts folder, then type "git checkout -b pep8"; this creates a new branch called pep8 and switches to it.
4. Now write all your changes to the files.
5. Then type "git commit -a" and enter a message when prompted.
6. Type "git push -u origin pep8" to push your changes to your moul-scripts repo; enter your username and password when prompted.
7. Finally, go to your Github moul-scripts repo, check your changes were added to the pep8 branch by selecting that branch, then, when you're confident everything is as it should be, click on the "Pull Requests" link and select "New pull request". Add a title for your pull request, a message detailing it, then send it for review. You're done!
Lyrositor
Explorer #16601888
Explorer #16601888
Re: Converting Python Scripts to meet PEP-8
thanks. That's why I asked for help. I figured there was some way easier to do this.
Let me ponder on what is happening...
I created a fork (copy) of moul-scripts on my GitHub account
I cloned my fork locally on my PC.
Locally, I checkout the scripts to some entity called pep-8
I make my changes to the files
I commit the changes (locally)
I push it up the the server
Then, online, I do a pull request which gets it over to H-uru for review.
Am I close?
EDIT: LOL! I tried it and managed to get it work (mostly) but I messed up putting the new files in the wrong place. Very annoying but I managed to delete everything back to the beginning and will start over from scratch again. I just love the learning curves on new things.
AND: Pull request sent as requested by Adam. I hope everything worked right. Let me know if I need to recall the request (and how to do it) and start over again.
Let me ponder on what is happening...
I created a fork (copy) of moul-scripts on my GitHub account
I cloned my fork locally on my PC.
Locally, I checkout the scripts to some entity called pep-8
I make my changes to the files
I commit the changes (locally)
I push it up the the server
Then, online, I do a pull request which gets it over to H-uru for review.
Am I close?
EDIT: LOL! I tried it and managed to get it work (mostly) but I messed up putting the new files in the wrong place. Very annoying but I managed to delete everything back to the beginning and will start over from scratch again. I just love the learning curves on new things.
AND: Pull request sent as requested by Adam. I hope everything worked right. Let me know if I need to recall the request (and how to do it) and start over again.
Re: Converting Python Scripts to meet PEP-8
Been busily working on Cleft scripts and busy testing them for errors.
I am concerned that making all these file compliant with PEP-8 may defeat the purpose for the standard. I'm running into some VERY long single commands that push the line length > 79 characters. I can edit them to meet the standard but I fear I may be sacrificing readability in some cases. I suspect no one is concerned if some of the lines are too long. In any case, I am adjusting the files so they do a clean pass through the PEP-8 scanner. If the group feels that the lines should be put back even if they exceed 79 chars, then I have no problem with it.
An example:
vs:
The last line is 80 chars long.
I am concerned that making all these file compliant with PEP-8 may defeat the purpose for the standard. I'm running into some VERY long single commands that push the line length > 79 characters. I can edit them to meet the standard but I fear I may be sacrificing readability in some cases. I suspect no one is concerned if some of the lines are too long. In any case, I am adjusting the files so they do a clean pass through the PEP-8 scanner. If the group feels that the lines should be put back even if they exceed 79 chars, then I have no problem with it.
An example:
Code: Select all
def SetStdGUIVisibility(self, visible):
global DialogName
if visible:
GUIDialogObject.value.draw.enable()
else:
mydialog = PtGetDialogFromString(DialogName)
ptGUIControlButton(
mydialog.getControlFromTag(kYeeshaPage01)).hide()
Code: Select all
def SetStdGUIVisibility(self, visible):
global DialogName
if visible:
GUIDialogObject.value.draw.enable()
else:
mydialog = PtGetDialogFromString(DialogName)
ptGUIControlButton(mydialog.getControlFromTag(kYeeshaPage01)).hide()
-
- Councilor of Technical Direction
- Posts: 2180
- Joined: Fri Nov 16, 2007 9:45 pm
- MOULa KI#: 23335
- Location: South Georgia
- Contact:
Re: Converting Python Scripts to meet PEP-8
Uru's python really lends itself to lines that are longer than 79 columns, so I prefer the second example. I have some other comments, but I will leave them on GitHub, which has excellent code review tools. Congratulations on getting your code on git though! If the git command line client continues to escape you, I find that Atlassian's SourceTree works well for Mercurial--hopefully the git support is just as good.

Re: Converting Python Scripts to meet PEP-8
Ok. I can fix that file. As you review the other files, let me know which ones you would like me to revert to longer lines. The PEP-8 scanner seems to have heart failure when it hits lines longer than 79 chars.
One convern I had is that when I pushed my local repository changes up to GitHub, is nattered that it was changing <LF> to <CR><LF>. Is this going to cause any problems with the files? I noticed that both the Python scripts and SDL files all have just the *nix <LF> as a line terminator.
One convern I had is that when I pushed my local repository changes up to GitHub, is nattered that it was changing <LF> to <CR><LF>. Is this going to cause any problems with the files? I noticed that both the Python scripts and SDL files all have just the *nix <LF> as a line terminator.
Re: Converting Python Scripts to meet PEP-8
Did anyone else notice that the SDL file for the nexus has the versions in reverse order in contrast with every other .SDL file?
I don't know how the SDL. parser works so I don't know if this is a problem or not.
I don't know how the SDL. parser works so I don't know if this is a problem or not.
- tachzusamm
- Posts: 575
- Joined: Thu May 29, 2008 2:03 am
- MOULa KI#: 0
- Location: Germany
Re: Converting Python Scripts to meet PEP-8
Thank you, I was not able to find it again. It was the Nexus, yeah.
http://forum.guildofwriters.org/viewtop ... 246#p55246
I already used the reverse order as well which was not a problem.
And the versions have numbers; only the highest number is valid. Those numbers would be useless if the order still matters.
http://forum.guildofwriters.org/viewtop ... 246#p55246
tachzusamm wrote:Now that you mention it: I *thought* I saw it reversed in an SDL example, but can't find it anymore. Maybe I just dreamt it.
I already used the reverse order as well which was not a problem.
And the versions have numbers; only the highest number is valid. Those numbers would be useless if the order still matters.
Re: Converting Python Scripts to meet PEP-8
I'm working on cleaning up all the SDL files now. I've stripped all the trailing whitespace, removed the incredible mess of mixed tabs and spaces, and reformatted everything so that you can actually read the files. The tabs were the biggest problem as it seems everyone who ever touched these files had a different tab setting on their text editors. some had 3 spaces, some 4, some 8, or their tabs used \t or spaces. Easiest solution... remove all the tabs (\t).
Working on the last one now: Personal.sdl. Not the largest file but the worst one I've seen so far.
Once I have loaded all these modified files into my dirtsand database and local client and tested everything, I'll be uploading them into the pep8 branch of my fork of moul-scripts in my GitHub account.
I found out how to turn off the auto CRLF in git so I have uoloaded the updated SDL files into the pep8 branch of my fork of moul-scripts on GitHub (johnsojc). They seem to be fine so far in the client... going to load them into my dirtsand server now.
Working on the last one now: Personal.sdl. Not the largest file but the worst one I've seen so far.
Once I have loaded all these modified files into my dirtsand database and local client and tested everything, I'll be uploading them into the pep8 branch of my fork of moul-scripts in my GitHub account.
I found out how to turn off the auto CRLF in git so I have uoloaded the updated SDL files into the pep8 branch of my fork of moul-scripts on GitHub (johnsojc). They seem to be fine so far in the client... going to load them into my dirtsand server now.
Last edited by johnsojc on Sat Jul 20, 2013 12:21 pm, edited 1 time in total.
-
- Councilor of Technical Direction
- Posts: 2180
- Joined: Fri Nov 16, 2007 9:45 pm
- MOULa KI#: 23335
- Location: South Georgia
- Contact:
Re: Converting Python Scripts to meet PEP-8
I'm slowly working through the commit(s) and adding my comments. There are so many changes that it will probably take me awhile to finish, so I'll post here when I'm done.


Hmm... Usually git for windows will checkout CRLF but commit LF line endings. You might have an unexpected setup that is confusing git. It was written by Linux, so expect it to be anal-retentive about things like thatjohnsojc wrote:One convern I had is that when I pushed my local repository changes up to GitHub, is nattered that it was changing <LF> to <CR><LF>. Is this going to cause any problems with the files? I noticed that both the Python scripts and SDL files all have just the *nix <LF> as a line terminator.

This is why we hate tabsjohnsojc wrote:The tabs were the biggest problem as it seems everyone who ever touched these files had a different tab setting on their text editors. some had 3 spaces, some 4, some 8, or their tabs used \t or spaces. Easiest solution... remove all the tabs (\t).

