GTG

Little cleanup on core.task.py (1 unused function and 1 function call + many pep8 changes.)

Bug #618439 reported by Thibault Févry
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GTG
New
Undecided
Unassigned

Bug Description

[Running latest code.]

Many other changes are in the branch, please dev don't review it, i'll make this clearer today or tomorrow.

 So, what I've done is basically change some things in task.py. {They were also minor changes in browser.py to correspond with the function that dissapeared, this should result in a performance enhancement, as we remove useless function calls.}

 I've done this :

Removed :
 #the id of this task in the project should be set
 #tid is a string ! (we have to choose a type and stick to it)
 self.tid = str(ze_id)

Added :
 self.tid = ze_id #If regression, str(ze_id)

This avoids useless calls of str(), removes the 2 comment lines that arn't needed anymore and also allows ta tracks futures bad uses of ze_id.
 So far it worked very well, no problem with test suite, no problem with adding tasks, if there's some regression the comment is there to help.

Removed get_self_and_all_subtasks. As this changes things in some places, will publish a branch instead of a patch.

Added a long comment about removing one function, I tried to remove it, but had a little problem doing it, so I left a comment, for someone that works pretty often with GTG!, iw will probably easy to do the change.

Pep8 cleanup, removed 43 of 51 warnings.

Reorganized sometimes comments to be clearer about some little things.

[old]I can't do a patch like bazaar ones, because it would remove all space changes and it's these changes that removes pep8 warnings. So i attach my own task.py file, which is ok in my computer. If you want I could provide a diff generated with bazaar, but that's a bit stupid, would remove 50% of my work.

This patch isn't very important, but from what I see, doesn't have any kind of negative effects.[/old]

This doesn't apply anymore, I forgot that some changes apply in some other places, just a patch won't help, i'll make a branch instead.

 [Oh, and btw, my email for the authors file, is ThibaultFevry[at]gmail[dot]com ].

Tags: patch
summary: - Little cleanup on core.task.py [Pep8 and one useless call of str()]
+ Little cleanup on core.task.py (1 unused function and 1 function call +
+ many pep8 changes.)
description: updated
description: updated
Revision history for this message
Thibault Févry (thibaultfevry) wrote :

My own task.py v2 (Made some changes, see description.)

 Overall there's a removal of 200 char, no more because I made a long comment explaining how to disable one function that is deprecated, but I don't know gtg! well enough to do that change, so I made it easier for others.

(Also, I made 3 more little changes, the first two in get_color() avoid using 2 var. (It uses 0, but still returns the right results and last change is minimal, removed one useless line.)

Revision history for this message
Thibault Févry (thibaultfevry) wrote :

This is the real patch in patch format, that doesn't have all the pep8 fixes, becauses bazaar skips some spaces fix.

You can use this if you don't want to use the .py file, or if you want a fast overview of the changes.

Revision history for this message
Thibault Févry (thibaultfevry) wrote :

 Ok, removing patches to do one branch, better, the patches didn't reflect all changes...

 Sorry.

description: updated
description: updated
Revision history for this message
Thibault Févry (thibaultfevry) wrote :

 Branch added.

 I can confirm that the changes on browser.py worked in my computer in debug mode (It's worth to try before commit this, there's still a risk i messed up sth, I don't know perfectly the code.)

tags: added: toreview
description: updated
tags: removed: toreview
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.