From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from <gentoo-soc+bounces-1344-garchives=archives.gentoo.org@lists.gentoo.org>) id 1QTy59-0003mO-8G for garchives@archives.gentoo.org; Tue, 07 Jun 2011 15:20:40 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4CAFF1C06D; Tue, 7 Jun 2011 15:20:21 +0000 (UTC) Received: from mail-pz0-f53.google.com (mail-pz0-f53.google.com [209.85.210.53]) by pigeon.gentoo.org (Postfix) with ESMTP id E9E761C06D for <gentoo-soc@lists.gentoo.org>; Tue, 7 Jun 2011 15:20:20 +0000 (UTC) Received: by pzk6 with SMTP id 6so2942861pzk.40 for <gentoo-soc@lists.gentoo.org>; Tue, 07 Jun 2011 08:20:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=OqjxlOl3CGbDxBfBU84yv2qGKTYBmHyHZiebB0XPb4w=; b=qDFTawfepnfuY2eOQstFvsAVjx5+YhCJf6nBZXsj8u4N0E818d8WKleeoWquDZUfAo ZrjCIxEI5cV371++ujKK4i3oEfRGvVNDcA+g4YneiAcEhbpbISmZFCB+2jxZuYuHB9s9 1D72pU35jT7L9ZMrnsECFzEnj02NG/LFDFmzg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=Gv2eZgSm42FspadoRJF6R4/zaYjDpviU5tPxG8a7kHhqydypDuwFaByA85dDJ16iXe M8V5ezRoZmS2D2+9lW9cojkfv74q0Ij1+ub5psPIpUozYOyJpajDnSXo089J2oPba7ch may18Vo60G5Pzv04umS+wu0ZnWOMaEsBUr3f0= Received: by 10.142.43.15 with SMTP id q15mr47173wfq.348.1307460020066; Tue, 07 Jun 2011 08:20:20 -0700 (PDT) Received: from [202.117.15.40] ([117.32.153.155]) by mx.google.com with ESMTPS id t15sm164321wfh.4.2011.06.07.08.20.10 (version=SSLv3 cipher=OTHER); Tue, 07 Jun 2011 08:20:18 -0700 (PDT) Message-ID: <4DEE40FC.5080902@gmail.com> Date: Tue, 07 Jun 2011 23:17:16 +0800 From: "Jiale Pan(Kyle Pan)" <kyle.j.pan@gmail.com> User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110521 Lightning/1.0b3pre Thunderbird/3.1.10 Precedence: bulk List-Post: <mailto:gentoo-soc@lists.gentoo.org> List-Help: <mailto:gentoo-soc+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-soc+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-soc+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-soc.gentoo.org> X-BeenThere: gentoo-soc@lists.gentoo.org Reply-to: gentoo-soc@lists.gentoo.org MIME-Version: 1.0 To: Serkan Kaba <serkan@gentoo.org> CC: gentoo-soc@lists.gentoo.org Subject: [gentoo-soc] Re: Gentoo/Java IDE integration-- Daily report--Kylepan References: <BANLkTik72qRyHmiTJ33gR7sHYfdQmnCL-Q@mail.gmail.com> <BANLkTi=CacWB_Z-myzkPLSN2DAz0-yC-Bw@mail.gmail.com> <BANLkTimhzgPVwUc_4sKc9KLTgTKTWyhMBw@mail.gmail.com> <BANLkTimb-jFE6P_ZocFNifLbJ8BERKeBZA@mail.gmail.com> In-Reply-To: <BANLkTimb-jFE6P_ZocFNifLbJ8BERKeBZA@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: cbc56d794aed4d1d607bae1ade8ea646 On 2011=E5=B9=B406=E6=9C=8807=E6=97=A5 14:08, Serkan Kaba wrote: > 2011/6/6 Kyle Pan<kyle.j.pan@gmail.com>: >> On Mon, Jun 6, 2011 at 14:48, Serkan Kaba<serkan@gentoo.org> wrote: >>> 2011/6/5 Kyle Pan<kyle.j.pan@gmail.com>: >>>> I've tried modified the main scripts(/usr/bin/java-config-2-2.6) to = a >>>> module. The modified java-config-2 version and a new version of >>>> QueryEnvDemo(QueryEnvDemo2.java) have been updated to svn. >>> Great. This makes it more programmattic. When do you plan to make an >>> api around it (instead of a simple demo)? >> >> right now I'm working on trying to develop the plugin's UI. It would >> be a few days I think. >> Can I do it as soon as this finishes. (And could you explain more >> about what do you "make an api around".. >> very sorry that I don't understand the phrase very clear ,er....) >> > Sorry I should have made it clearer. Currently there are methods > defined in Python. You should make the accompanying Java API that > accesses those methods. Your upper layers shouldn't call Python code > directly. I've added class containing accompanying Java API that acts as wrappers,=20 to access methods in java_config_2_api instead of directly calling them.=20 It is committed to svn companied with a test class. Please check whether=20 I've catch your meaning when you have time.( I think yes:) Thanks. >>>> >>>> In order to change java-config-2 to a Python module to use in >>>> program, besides some modifications in its code, the ultimately >>>> installed filename(/usr/bin/java-config-2-2.6) should be changed, fo= r >>>> hyphen and dot cannot be use as module identifiers and .py should be >>>> added.(see my QueryEnvDemo2). And my chosen name is >>>> java_config_2_2_6.py >>>> >>>> So to run the demo: >>>> After emerging the modified java-config-2 >>>> (still use this ebuild[1]) >>>> should manually change /usr/bin/java-config-2-2.6 to >>>> /usr/bin/java_config_2_2_6.py >>> I don't think version number should be hyphened as well but not sure. >> If a python script wanna be a module, it's name cannot contain >> hyphen and dot--otherwise it cannot be imported--I've tried. >> >>>> >>>> >>>> issues: >>>> currently the filename change is done manually, and it definitely >>>> should be installed(emerging) with the right name automatically. How >>>> to do it seems a little bit complicated and I don't know, though I'v= e >>>> already done some inspections: >>>> >>>> when user calls java-config in shell, >>>> /usr/bin/java-config executes, >>>> it's a shell script and actually executes /usr/bin/java-config-2. >>>> >>>> /usr/bin/java-config-2 seems rather complicated but I still got what= it does: >>>> /usr/bin/java-config-2 does some checks and finally choose to execu= te >>>> /usr/bin/java-config-2-2.6 or /usr/bin/java-config-2-3.1 according t= o >>>> what it finds. >>>> >>>> So if I change the name of /usr/bin/java-config-2-2.6, the >>>> /usr/bin/java-config-2 script should also be changed accordingly. >>>> However, I should not change it directly, it's header says it is >>>> generated by python_generate_wrapper_scripts(). But I don't know wha= t >>>> the original script is. >>> That's generated by distutils. You may change the source file name >>> with underscores but we need to examine whether it effects other >>> packages. (java-config-wrapper is definetely effected) >> >> I find the code place to change the filename: setup.py in project's >> root directory. >> the code snippet: >> >> package_dir =3D { 'java_config_2' : 'src/java_config_2' }, >> scripts =3D ['src/java-config-2','src/depend-java-query','src/= run-java-tool', >> 'src/gjl'], >> data_files =3D [ >> >> I change the second line to:(of course the file src/java-config-2 is >> renamed to java_config_2.py before doing this) >> scripts =3D ['src/java_config_2.py','src/depend-java-query','src/run-j= ava-tool', >> 'src/gjl'], >> >> and it emerged well, >> >> BUT this still CANNOT achieve what I want, the resulting file name >> after emerging becomes: >> >> /usr/bin/java_config_2.py-2.6 >> /usr/bin/java_config_2.py-3.1 >> >> it seems that distutils always add -2.6 and -3.1 automatically. And I >> think it's not proper to modify distutils for >> it is maintained by Python(isn't it?). >> So this method isn't a solution I think. >> >> And I propose another solution: >> I can >> cp ${project's root}/java-config-2 ${project's >> root}/src/java_config_2/java_config_2.py >> >> and then making necessary small code modifications to let it can be >> used a module. >> modules in ${project's root}/src/java_config_2/ will be installed to >> /usr/lib/python2.6/site-packages/java_config_2/ automatically >> with the original filename. Doing this can leaving the original >> java-config-2 file intact as well as not messing dealing >> with changes to java-config-wrapper project >> >> What do you think? >> >> >> >> >> >> -- >> Best Regards, >> Jiale Pan (Kyle Pan) >> > > What I suggest is to extract the API part to seperate file that can be > imported as a module (for example java_config_2_api). > I have updated the java_config_2_api.py to svn, containing the minimal=20 required function I currently need. I didn't delete the other ones(=20 instead, I commented) because if I find that I need another one in it=20 during my development, I can easily uncomment and use it. However,=20 they'll be cleaned up after all the plugin work finishes. > Regards, > Serkan > --=20 Best regards, Jiale Pan(Kyle Pan)