[ditrack commit] r948 - src/trunk/DITrack

Vlad Skvortsov vss at 73rus.com
Tue Dec 19 09:25:22 PST 2006


oleg at ditrack.org wrote:
> Author: oleg
> Date: 2006-12-12 09:04:12 -0800 (Tue, 12 Dec 2006)
> New Revision: 948
>
> Modified:
>    src/trunk/DITrack/DB.py
> Log:
> implemented the method for checking a issue number (DB::check_issue_number)
>   
Perl or C++ background? :-) Let's stick to the Python convention of 
denoting method names like Abc.def().
>
> Modified: src/trunk/DITrack/DB.py
> ===================================================================
> --- src/trunk/DITrack/DB.py	2006-12-12 09:53:38 UTC (rev 947)
> +++ src/trunk/DITrack/DB.py	2006-12-12 17:04:12 UTC (rev 948)
> @@ -1571,3 +1571,10 @@
>  	name = self.lma.new_issue(issue)
>  
>  	return name, issue
> +
> +    def check_issue_number(self, id):
>   
1. Per our design document, 'id' == 'number' || 'name'. Here you are 
actually checking if the passed string is an identifier, hence the name 
is misleading.
2. The method name doesn't give a clue of what is the method semantics. 
I suggest naming it like something as 'is_valid_issue_id'.
> +	
> +	if self.issue_number_re.match(id) or self.issue_name_re.match(id):
> +	    return True
> +	else:
> +	    return False
>
> _______________________________________________
> Commit mailing list
> Commit at lists.ditrack.org
> http://lists.ditrack.org/mailman/listinfo/commit
>   


-- 
Vlad Skvortsov, vss at 73rus.com, http://vss.73rus.com



More information about the Dev mailing list