Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'syntax': 0.03; 'argument': 0.04; '(except': 0.05; 'none:': 0.05; 'url:launchpad': 0.05; 'bug.': 0.07; 'dev': 0.07; 'rewrite': 0.07; 'python': 0.09; '**kwargs):': 0.09; 'anymore.': 0.09; 'arg': 0.09; 'bool': 0.09; 'buttons': 0.09; 'docstrings': 0.09; 'given,': 0.09; 'highlighting': 0.09; 'implemented.': 0.09; 'kwargs': 0.09; 'tab': 0.09; 'to:addr:comp.lang.python': 0.09; 'bug': 0.10; 'cc:addr :python-list': 0.10; 'looked': 0.10; 'def': 0.10; 'anyway': 0.11; 'portion': 0.13; 'yet.': 0.13; 'cases': 0.15; 'interfaces': 0.15; 'value.': 0.15; '"""checks': 0.16; "(i'm": 0.16; 'backward': 0.16; 'decent': 0.16; 'editor,': 0.16; 'false):': 0.16; 'imo.': 0.16; 'pressed': 0.16; 'stability.': 0.16; 'syntax.': 0.16; 'tabs': 0.16; 'traceback.': 0.16; 'value=none):': 0.16; 'verbose': 0.16; 'wrote:': 0.17; 'tend': 0.17; '>>>': 0.18; 'changes': 0.20; 'otherwise,': 0.20; 'parameters': 0.20; 'written': 0.20; 'hey': 0.21; 'disable': 0.22; 'stick': 0.22; 'help.': 0.22; 'cheers,': 0.23; 'example': 0.23; 'work.': 0.23; "i've": 0.23; 'thus': 0.24; 'cc:no real name:2**0': 0.24; 'second': 0.24; 'cc:2**1': 0.24; 'pass': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'values': 0.26; 'cc:addr:gmail.com': 0.27; 'coding': 0.27; 'possibly': 0.27; 'core': 0.27; '???': 0.27; 'interface': 0.27; 'there.': 0.28; 'correct': 0.28; 'indentation': 0.29; 'lot.': 0.29; 'optional': 0.29; 'question:': 0.29; 'trigger': 0.29; 'probably': 0.29; "i'm": 0.29; 'maybe': 0.29; 'related': 0.30; 'basic': 0.30; 'feedback': 0.30; 'sense': 0.31; 'help,': 0.32; 'could': 0.32; "aren't": 0.33; 'traceback': 0.33; 'code:': 0.33; 'version': 0.34; 'changed': 0.34; 'received:google.com': 0.34; 'loss': 0.34; 'done': 0.34; 'thanks': 0.34; 'adds': 0.35; 'fail': 0.35; 'programming.': 0.35; 'skip:k 20': 0.35; 'stable': 0.35; 'expected': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'there': 0.35; 'next': 0.35; 'really': 0.36; 'but': 0.36; 'closing': 0.36; 'method': 0.36; "i'll": 0.36; 'should': 0.36; 'too': 0.36; 'bad': 0.37; 'editor': 0.37; 'one,': 0.37; 'option': 0.37; 'previous': 0.37; 'quite': 0.37; 'received:209': 0.37; 'well.': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'files': 0.38; 'some': 0.38; 'release': 0.39; 'notice': 0.39; 'called': 0.39; 'save': 0.61; "you'll": 0.62; 'making': 0.64; 'here': 0.65; 'become': 0.65; 'privacy': 0.65; 'concerns': 0.65; 'joy': 0.65; 'risk': 0.66; 'potentially': 0.66; 'increase': 0.72; 'click': 0.76; 'heavy': 0.83; 'plugins': 0.84; 'trig': 0.84; 'wheel': 0.84; 'hate': 0.93 Newsgroups: comp.lang.python Date: Mon, 9 Jul 2012 06:33:31 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=81.83.162.247; posting-account=9-In_woAAACDnDFyCeZyZytl1ttJ-5Gp References: <2081b59a-40af-4fc8-a9c2-6d76b2d61e96@googlegroups.com> User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 81.83.162.247 MIME-Version: 1.0 Subject: Re: Deditor 0.4.0 From: Kruptein To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Kruptein , python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Message-ID: Lines: 146 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1341840815 news.xs4all.nl 6887 [2001:888:2000:d::a6]:44883 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:25083 Op maandag 9 juli 2012 14:54:03 UTC+2 schreef Jean-Michel Pichavant het vol= gende: > Kruptein wrote: > > Op maandag 9 juli 2012 13:05:58 UTC+2 schreef Jean-Michel Pichavant het= volgende: > > =20 > >> Kruptein wrote: > >> =20 > >>> Hey I released a new version of my python-focused text-editor. > >>> you can download it at http://launchpad.net/deditor > >>> > >>> What is it? > >>> Deditor is aimed to be a text-editor which can be used as a basic tex= t-editor as gedit or with the right plugins become a full-feature ide. > >>> I focus on making it a python specific editor but you can use it to e= dit other files as well. > >>> It is python specific because the plugin system that is used (DPlug) = is written in python and thus all plugins are written in python. Also some= of the plugins there is one plugin that comes bundled with deditor that ad= ds some python specific features like code-analyzing, code-inspection, auto= -completion etc. > >>> > >>> So plugins are the main core of the program you can disable and enabl= e plugins at your will. The plugins that come bundled are made to increase= the joy of programming. > >>> > >>> NOTICE that this I don't regard this as a stable product yet. There = is no high risk in data loss and there are definitely no privacy concerns b= ut you should still be aware that there are bugs/malfunctions and that you = will encounter them. > >>> > >>> I hope some of you like it and if you don't try to give some construc= tive criticism :) > >>> > >>> > >>> Most changes in regard to previous release are under the hood. so ex= isting users might not notice a lot. > >>> Also the customize plugin's second configuration tab: syntax highligh= ting is bugged try to avoid it :p > >>> =20 > >>> =20 > >> Good job. > >> > >> I have 2 question: > >> Aren't you reinventing the wheel ? > >> No way to use tabs for tabulation ??? (I'm CEO of the 'space haters cl= ub') > >> > >> Otherwise, I found this bug : > >> Start the editor, click twice on 'Analyse code', and you'll get a trac= eback. > >> I looked into the related code: > >> > >> def dUpdate(self, trig, value=3DNone): > >> if trig =3D=3D "tabclosed": > >> return self.tabClosed(value) > >> > >> def tabClosed(self, tab): > >> """Checks if the tab that is closing is a project""" > >> if tab.parentTab =3D=3D None: > >> pass > >> > >> > >> Your method interfaces are quite inconsistent, I sense this is quite= =20 > >> global to your code: > >> > >> 1/ dUpdate has None as default value for 'value' > >> 2/ tab.parentTab will fail if tab is None > >> 3/ on the traceback you get from the bug above, a bool has been given,= =20 > >> bool has no parentTab. > >> > >> > >> Here are 2 advices: > >> > >> 1/ Default values are for the fool/weak/noob/..., your pick. I tend to= =20 > >> use them only for backward compatibilty or for interface stability.=20 > >> Otherwise, it's better not to use them. Some people still use them=20 > >> appropriately but in your I think it may help. > >> > >> 2/ In your docstrings, note down the expected type of your parameters= =20 > >> (only 1 type ! (except for the None alternative)) and stick to it. > >> > >> Regards, > >> > >> JM > >> =20 > > > > To begin with not everything that I want to see is yet implemented. A = lot still has to be done for example indentation although I really hate tab= s ;D I will give the option in a future release maybe even the next one. > > > > I'll check the bug as it probably is indeed a bug. > > > > Regarding the default value dUpdate is a method from the plugin system = and is called when a trigger is updated. some triggers give an additional = value for example a trigger that registers pressed buttons could potentiall= y give which exact key as value. However some triggers don't need this add= itional value. If a plugin needs both types of triggers the method will ne= ed this default value to work. Also the dev version already changed that t= here always will be sent a value so no need for the default value anymore. > > > > =20 > If you can, use the **kwargs syntax. > def foo(tabs, **kwargs): > # optional arg > if kwargs.get('saveFile', False): > self.saveFile(tab.file) > # required arg > if kwargs['saveFile']: > self.saveFile() > =20 >=20 > The type of kwargs will be consistent, it will be always a dictionnary,= =20 > possibly an empty one, but still a dictionnary, and best part of it, if= =20 > you change the number of argument in the call, you don't break your=20 > interface. >=20 > > Regarding the docstrings: as deditor still is under heavy development n= ot all docstrings are correct or even there. > > > > =20 > Yep, but writing the expected type of your parameters always help, in=20 > particular during the dev phase. you can save the verbose part of the=20 > documentation for later. >=20 > Cheers, >=20 > JM Yeah I started to use kwargs in some methods but it's only usefull in some = cases imo. I'm a pretty decent python dev imo but I know that there is still a lot tha= t I've to learn so often if I get to know something knew I tend to rewrite = a large portion of my program(s) and thus I often am too lazy to write prop= er docstrings as they would change anyway (<- very bad coding practice thou= gh ^^) Thanks for the feedback anyways :)