GTG

Merge lp:~jml/gtg/returnlist-to-list into lp:~gtg/gtg/old-trunk

Proposed by Jonathan Lange
Status: Merged
Merged at revision: not available
Proposed branch: lp:~jml/gtg/returnlist-to-list
Merge into: lp:~gtg/gtg/old-trunk
Diff against target: None lines
To merge this branch: bzr merge lp:~jml/gtg/returnlist-to-list
Reviewer Review Type Date Requested Status
Gtg developers Pending
Review via email: mp+8677@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jonathan Lange (jml) wrote :

Another round at getting rid of returnlist. This time, instead of using deepcopy, it uses list().

lp:~jml/gtg/returnlist-to-list updated
269. By Jonathan Lange

Remove unneeded import.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'GTG/core/requester.py'
2--- GTG/core/requester.py 2009-07-13 08:57:44 +0000
3+++ GTG/core/requester.py 2009-07-13 09:33:19 +0000
4@@ -18,8 +18,6 @@
5 # -----------------------------------------------------------------------------
6
7
8-from GTG.tools.listes import *
9-
10 #Requester is a pure View object. It will not do anything but it will
11 #be used by any Interface to handle the requests to the datastore
12
13@@ -236,7 +234,7 @@
14
15 def get_all_tags(self):
16 """Return a list of every tag that was ever used."""
17- return returnlist(self.ds.get_tagstore().get_all_tags())
18+ return list(self.ds.get_tagstore().get_all_tags())
19
20 def get_notag_tag(self) :
21 return self.ds.get_tagstore().get_notag_tag()
22
23=== modified file 'GTG/core/task.py'
24--- GTG/core/task.py 2009-07-13 08:57:44 +0000
25+++ GTG/core/task.py 2009-07-13 09:33:19 +0000
26@@ -318,7 +318,7 @@
27 return zelist
28
29 def get_subtasks_tid(self) :
30- return returnlist(self.children)
31+ return list(self.children)
32
33
34 #add and remove parents are private
35@@ -345,7 +345,7 @@
36 parent.sync()
37
38 def get_parents(self):
39- return returnlist(self.parents)
40+ return list(self.parents)
41
42 #Return true is the task has parent
43 #If tag is provided, return True only
44@@ -398,7 +398,7 @@
45
46 #return a copy of the list of tag objects
47 def get_tags(self) :
48- return returnlist(self.tags)
49+ return list(self.tags)
50
51 #This function add tag by name
52 def add_tag(self, tagname):
53
54=== removed file 'GTG/tools/listes.py'
55--- GTG/tools/listes.py 2009-07-13 08:58:13 +0000
56+++ GTG/tools/listes.py 1970-01-01 00:00:00 +0000
57@@ -1,30 +0,0 @@
58-# -*- coding: utf-8 -*-
59-# -----------------------------------------------------------------------------
60-# Gettings Things Gnome! - a personnal organizer for the GNOME desktop
61-# Copyright (c) 2008-2009 - Lionel Dricot & Bertrand Rousseau
62-#
63-# This program is free software: you can redistribute it and/or modify it under
64-# the terms of the GNU General Public License as published by the Free Software
65-# Foundation, either version 3 of the License, or (at your option) any later
66-# version.
67-#
68-# This program is distributed in the hope that it will be useful, but WITHOUT
69-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
70-# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
71-# details.
72-#
73-# You should have received a copy of the GNU General Public License along with
74-# this program. If not, see <http://www.gnu.org/licenses/>.
75-# -----------------------------------------------------------------------------
76-
77-#Return a copy of the list and avoid a to keep the same object
78-#It handles multilple dimension matrix through recursion
79-def returnlist(liste) :
80- if liste.__class__ is list :
81- to_return = []
82- for i in liste :
83- elem = returnlist(i)
84- to_return.append(elem)
85- else :
86- to_return = liste
87- return to_return

Subscribers

People subscribed via source and target branches

to status/vote changes: