Re: Python refactoring question and create dynamic attributes

2019-06-23 Thread DL Neil
On 23/06/19 7:56 PM, Arup Rakshit wrote: In the below code: @classmethod def find(self, id): if isinstance(id, list): rows = self.__table__().get_all(*id).run(self.__db__().conn) result = [] for row in rows: acategory = C

Re: Python refactoring question and create dynamic attributes

2019-06-23 Thread MRAB
On 2019-06-23 10:44, Arup Rakshit wrote: On 23-Jun-2019, at 2:31 PM, Cameron Simpson wrote: On 23Jun2019 13:26, Arup Rakshit wrote: In the below code: @classmethod def find(self, id): if isinstance(id, list): rows = self.__table__().get_all(*id).run(self.__db__().conn)

Re: Python refactoring question and create dynamic attributes

2019-06-23 Thread Arup Rakshit
> On 23-Jun-2019, at 2:31 PM, Cameron Simpson wrote: > > On 23Jun2019 13:26, Arup Rakshit wrote: >> In the below code: >> >> @classmethod >> def find(self, id): >> if isinstance(id, list): >> rows = self.__table__().get_all(*id).run(self.__db__().conn) >> result =

Re: Python refactoring question and create dynamic attributes

2019-06-23 Thread Cameron Simpson
On 23Jun2019 13:26, Arup Rakshit wrote: In the below code: @classmethod def find(self, id): if isinstance(id, list): rows = self.__table__().get_all(*id).run(self.__db__().conn) result = [] for row in rows: acategory = Category()

Python refactoring question and create dynamic attributes

2019-06-23 Thread Arup Rakshit
In the below code: @classmethod def find(self, id): if isinstance(id, list): rows = self.__table__().get_all(*id).run(self.__db__().conn) result = [] for row in rows: acategory = Category() acategory.__dict__.updat

Re: Refactoring question

2007-04-04 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Apr 3, 11:41 pm, "ginstrom" <[EMAIL PROTECTED]> wrote: >>> On Behalf Of Kevin Walzer >>> What's the best way to do this? Can anyone point me in the >>> right direction? How could, for instance, the top snippet be >>> rewritten to separate the Tkinter parts from the gen

Re: Refactoring question

2007-04-04 Thread kyosohma
On Apr 3, 11:41 pm, "ginstrom" <[EMAIL PROTECTED]> wrote: > > On Behalf Of Kevin Walzer > > What's the best way to do this? Can anyone point me in the > > right direction? How could, for instance, the top snippet be > > rewritten to separate the Tkinter parts from the generic stuff? > > I like to u

Re: Refactoring question

2007-04-03 Thread ginstrom
> On Behalf Of Kevin Walzer > What's the best way to do this? Can anyone point me in the > right direction? How could, for instance, the top snippet be > rewritten to separate the Tkinter parts from the generic stuff? I like to use the broadcaster/broker recipe at http://aspn.activestate.com/ASPN/

Refactoring question

2007-04-03 Thread Kevin Walzer
I currently have a GUI application (using Tkinter) in which all the code is placed in a single script. This means that the GUI bits are a bit too tightly bound to the "under-the-hood" logic of the app. Here's an example snippet: def installPackage(self): self.package = self.infotable.

refactoring question

2006-05-04 Thread bryan rasmussen
Hi, I'm doing a sort of symbolic linking app in Windows for my own enjoyment, and figured I would do it in python for the same reason + learning the language. The following functions could obviously do with some refactoring. One obvious thing would be to make wordsetter and wordsforfolder more gen