pydev-code Mailing List for PyDev for Eclipse (Page 17)
Brought to you by:
fabioz
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
(14) |
Apr
(18) |
May
(12) |
Jun
(34) |
Jul
(31) |
Aug
(37) |
Sep
(22) |
Oct
(2) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(1) |
Feb
(4) |
Mar
(9) |
Apr
(1) |
May
|
Jun
(2) |
Jul
(24) |
Aug
(3) |
Sep
(5) |
Oct
(3) |
Nov
(3) |
Dec
(5) |
2006 |
Jan
(5) |
Feb
(23) |
Mar
(5) |
Apr
(80) |
May
(26) |
Jun
(13) |
Jul
(13) |
Aug
(4) |
Sep
(31) |
Oct
(24) |
Nov
(6) |
Dec
(2) |
2007 |
Jan
(7) |
Feb
|
Mar
(26) |
Apr
(3) |
May
(8) |
Jun
(6) |
Jul
(11) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
(9) |
Dec
(3) |
2008 |
Jan
(7) |
Feb
(1) |
Mar
(6) |
Apr
(7) |
May
(9) |
Jun
(14) |
Jul
(9) |
Aug
(6) |
Sep
(10) |
Oct
(5) |
Nov
(8) |
Dec
(5) |
2009 |
Jan
(8) |
Feb
(10) |
Mar
(10) |
Apr
(1) |
May
(3) |
Jun
(5) |
Jul
(10) |
Aug
(3) |
Sep
(12) |
Oct
(6) |
Nov
(22) |
Dec
(12) |
2010 |
Jan
(10) |
Feb
(17) |
Mar
(5) |
Apr
(9) |
May
(8) |
Jun
(2) |
Jul
(4) |
Aug
(12) |
Sep
(1) |
Oct
(1) |
Nov
(8) |
Dec
|
2011 |
Jan
(14) |
Feb
(8) |
Mar
(3) |
Apr
(11) |
May
(6) |
Jun
(5) |
Jul
(10) |
Aug
(7) |
Sep
|
Oct
(4) |
Nov
(4) |
Dec
(8) |
2012 |
Jan
|
Feb
(8) |
Mar
(10) |
Apr
(5) |
May
(4) |
Jun
(10) |
Jul
|
Aug
(2) |
Sep
(2) |
Oct
(11) |
Nov
(1) |
Dec
|
2013 |
Jan
(1) |
Feb
(2) |
Mar
(11) |
Apr
(10) |
May
(7) |
Jun
(9) |
Jul
(13) |
Aug
(20) |
Sep
(4) |
Oct
(18) |
Nov
(5) |
Dec
(7) |
2014 |
Jan
(3) |
Feb
(5) |
Mar
(7) |
Apr
(5) |
May
(10) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(7) |
Oct
(1) |
Nov
(1) |
Dec
(1) |
2015 |
Jan
(1) |
Feb
(1) |
Mar
(8) |
Apr
(3) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
(2) |
Sep
(1) |
Oct
(3) |
Nov
(5) |
Dec
(1) |
2016 |
Jan
(26) |
Feb
(10) |
Mar
(4) |
Apr
|
May
(4) |
Jun
(3) |
Jul
|
Aug
(1) |
Sep
|
Oct
(1) |
Nov
(4) |
Dec
(3) |
2017 |
Jan
(3) |
Feb
|
Mar
(9) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
(9) |
Sep
(1) |
Oct
|
Nov
(2) |
Dec
|
2018 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(4) |
Oct
(2) |
Nov
(1) |
Dec
(3) |
2019 |
Jan
(4) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
|
Sep
|
Oct
(3) |
Nov
|
Dec
|
2020 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(4) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(11) |
2021 |
Jan
(3) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2024 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
From: Fabio Z. <fza...@ap...> - 2011-05-30 22:38:37
|
Hi All, Pydev 2.1.0 has been released Details on Pydev: http://pydev.org Details on its development: http://pydev.blogspot.com Release Highlights: ------------------------------- Code Analysis By default, only the currently opened editor will be analyzed (resulting in much shorter build times). Added action to force the analysis on a given folder or file. Showing error markers for PyDev elements in the tree. New option to remove error markers when the editor is closed (default). Editor Override method completions (Ctrl+Space after a 'def ') . Completions starting with '_' now have lower priority. Fixed major issue when replacing markers which could make errors appear when they shouldn't appear anymore Auto-linking on close parens is now optional (and disabled by default). Code coverage No longer looses the selection on a refresh. Fixed issue where coverage was not working properly when running with multiple processes. Added orientation options PyUnit Added feature to relaunch the last launch when file changes (with option to relaunch only errors). setUpClass was not called when running with the pydev test runner F12 makes the editor active even if there's a tooltip active in the PyUnit view. The PyUnit tooltip is now properly restoring the focus of the previous active control. Added orientation options And a bunch of other bug-fixes. Note: Java 1.4 is no longer supported (at least Java 5 is required now). What is PyDev? --------------------------- PyDev is a plugin that enables users to use Eclipse for Python, Jython and IronPython development -- making Eclipse a first class Python IDE -- It comes with many goodies such as code completion, syntax highlighting, syntax analysis, refactor, debug and many others. Cheers, -- Fabio Zadrozny ------------------------------------------------------ Software Developer Appcelerator http://appcelerator.com/ Aptana http://aptana.com/ Pydev - Python Development Environment for Eclipse http://pydev.org http://pydev.blogspot.com |
From: Fabio Z. <fa...@es...> - 2011-05-25 00:51:32
|
Just added something to the feature request (if more people have interest, maybe it could become something more integrated into pydev)... Cheers, Fabio On Tue, May 24, 2011 at 9:31 AM, Álvaro J. Iradier <air...@gm...> wrote: > Hi Fabio, > > did you get some time to check and give us some ideas on how to start > this web2py support using predefined completions? > > Thanks, and sorry for insisting. > > > On Fri, Apr 29, 2011 at 1:43 PM, Álvaro J. Iradier <air...@gm...> wrote: >> It sounds better than OK, thanks very much,. >> >> Request ID 3294887 >> >> https://sourceforge.net/tracker/?func=detail&aid=3294887&group_id=85796&atid=577332 >> >> Greets. >> >> On Fri, Apr 29, 2011 at 12:39 PM, Fabio Zadrozny <fa...@gm...> wrote: >>> Hi Alvaro, >>> >>> I think that almost all there can be done with the predefined >>> completions... Let's do the following: Create a feature request and >>> attach the sample project from your web2py_example, from there, I'll >>> start providing the initial structure and will give you the next steps >>> and we can go from there... does that sound OK for you? >>> >>> Cheers, >>> >>> Fabio >>> >>> On Fri, Apr 29, 2011 at 5:46 AM, Álvaro J. Iradier <air...@gm...> wrote: >>>> Hi Fabio, I don't know if you're familiar with web2py, I'll try to >>>> give you an example. >>>> >>>> Project in Eclipse: web2py_example >>>> >>>> Structure: >>>> --------------------------------------- >>>> web2py_example >>>> src/ >>>> cache/ >>>> controllers/ >>>> default.py >>>> cron/ >>>> databases/ >>>> errors/ >>>> languages/ >>>> models/ >>>> config.py >>>> db.py >>>> db_functions.py >>>> db_models.py >>>> db_others.py >>>> mail.py >>>> menu.py >>>> version.py >>>> modules/ >>>> ... >>>> .project >>>> .pydevproject >>>> --------------------------------------- >>>> >>>> The 'src' folder is linked to the web2py application folder, for >>>> example, src-> c:\web2py\applications\my_application. Some examples of >>>> files: >>>> >>>> models/db.py: >>>> ------------------------------------------------ >>>> # coding: utf8 >>>> db = DAL('sqlite://storage.sqlite') >>>> ... >>>> ------------------------------------------------ >>>> >>>> models/db_functions.py: >>>> ------------------------------------------------ >>>> # coding: utf8 >>>> >>>> DATETIME_FORMAT = "%d/%m/%Y %H:%M:%S" >>>> >>>> def get_latest_sample_date(): >>>> maxID = db.sensor_samples.id.max() >>>> ... >>>> ------------------------------------------------ >>>> >>>> models/menu.py: >>>> ------------------------------------------------ >>>> response.title = request.application >>>> >>>> if request.function == 'somefunction': >>>> response.menu = ... >>>> else: >>>> response.menu = ... >>>> ... >>>> ------------------------------------------------ >>>> >>>> >>>> controllers/default.py: >>>> ------------------------------------------------ >>>> @auth.requires_login() >>>> def index(): >>>> time = datetime.now().strftime(DATETIME_FORMAT) >>>> latest = get_latest_sample_date() >>>> response.flash = 'Sample message' >>>> >>>> return dict( >>>> time=time, >>>> latestSample=latest) >>>> ... >>>> ------------------------------------------------ >>>> >>>> On web2py, the code for function 'index' on controllers/default.py is >>>> run when you navigate to http://server/my_application/deafult/index. >>>> >>>> Web2py "magically" populates an environment, so some instances like >>>> 'request', 'response', 'session', and some modules and classes are >>>> imported. Then, web2py evals all the files in the models/ folder. >>>> Finally, it evals the controllers/default.py file, and calls the >>>> 'index' function (the returned dictionary is passed to the >>>> corresponding view, but that doesn't matter right now). >>>> >>>> So, what do I want to achieve? >>>> >>>> When editing a file in models/ (for example models/db.py), I would >>>> like pydev to know about that DAL was imported from gluon.dal.DAL >>>> (web2py does it automatically). >>>> >>>> Then, in models/db_functions.py I would like pydev to know about the >>>> 'db' variable, which was created in modles/db.py (web2py evaluates >>>> these files in alphabetical order, so db.py comes befure >>>> db_functions.py). >>>> >>>> Also in models/menu.py, I would like pydev to know that request and >>>> response are instances of gluon.globals.Request and >>>> gluon.globals.Response respectively, etc. >>>> >>>> When editing the file controlles/default.py, I'd like web2py to know >>>> about 'request', 'response' (and some others), as well as about the >>>> declarations in all the models/ file (in the code example, I'm calling >>>> the 'get_latest_sample_date' function declared in >>>> models/db_functions.py) >>>> >>>> Basically, I want to setup the environment in a similar way to what is >>>> done by web2py in gluon.compilyapp, functions 'build_environment' and >>>> 'run_models': >>>> >>>> ------------------------------------- >>>> def build_environment(request, response, session): >>>> """ >>>> Build the environment dictionary into which web2py files are executed. >>>> """ >>>> >>>> environment = {} >>>> for key in html.__all__: >>>> environment[key] = getattr(html, key) >>>> >>>> # Overwrite the URL function with a proxy >>>> # url function which contains this request. >>>> environment['URL'] = html._gURL(request) >>>> >>>> for key in validators.__all__: >>>> environment[key] = getattr(validators, key) >>>> if not request.env: >>>> request.env = Storage() >>>> environment['T'] = translator(request) >>>> environment['HTTP'] = HTTP >>>> environment['redirect'] = redirect >>>> environment['request'] = request >>>> environment['response'] = response >>>> environment['session'] = session >>>> environment['cache'] = Cache(request) >>>> environment['DAL'] = DAL >>>> environment['Field'] = Field >>>> environment['SQLDB'] = SQLDB # for backward compatibility >>>> environment['SQLField'] = SQLField # for backward compatibility >>>> environment['SQLFORM'] = SQLFORM >>>> environment['SQLTABLE'] = SQLTABLE >>>> environment['LOAD'] = LoadFactory(environment) >>>> environment['local_import'] = \ >>>> lambda name, reload=False, app=request.application:\ >>>> local_import_aux(name,reload,app) >>>> BaseAdapter.set_folder(os.path.join(request.folder, 'databases')) >>>> response._view_environment = copy.copy(environment) >>>> return environment >>>> >>>> def run_models_in(environment): >>>> """ >>>> Runs all models (in the app specified by the current folder) >>>> It tries pre-compiled models first before compiling them. >>>> """ >>>> >>>> folder = environment['request'].folder >>>> path = os.path.join(folder, 'compiled') >>>> if os.path.exists(path): >>>> for model in listdir(path, '^models_.+\.pyc$', 0): >>>> restricted(read_pyc(model), environment, layer=model) >>>> else: >>>> models = listdir(os.path.join(folder, 'models'), '^\w+\.py$', >>>> 0) >>>> for model in models: >>>> layer = model >>>> if is_gae: >>>> code = getcfs(model, model, >>>> lambda: compile2(open(model, 'r').read(),layer)) >>>> else: >>>> code = getcfs(model, model, None) >>>> restricted(code, environment, layer) >>>> >>>> ------------------------------------- >>>> >>>> So, do you think this can be done just with scripting, or will it >>>> require extending pydev? >>>> >>>> Suggestions are welcome, and I think web2py developers would find this >>>> very useful. >>>> >>>> Greets. >>>> >>>> On Thu, Apr 28, 2011 at 3:32 PM, Fabio Zadrozny <fa...@es...> wrote: >>>>> On Thu, Apr 28, 2011 at 10:18 AM, Álvaro J. Iradier <air...@gm...> wrote: >>>>>> That might work for predefined classes or items, like "request", >>>>>> "response", "session"..., but I want to go further. I want to >>>>>> dinamically parse the files in models/, which define some variables >>>>>> and functions, and I want to make those available too. >>>>>> >>>>>> Is it possible to get this far using the jython scripting, or should I >>>>>> develop a plugin or a patch for pydev? >>>>>> >>>>> >>>>> Can you give an actual example with code on what you want to achieve? >>>>> >>>>> Cheers, >>>>> >>>>> Fabio >>>>> >>>>> >>>>>> Greets. >>>>>> >>>>>> On Thu, Apr 28, 2011 at 3:07 PM, Fabio Zadrozny <fab...@gm...> wrote: >>>>>>> Might be easier providing predefined completions (i.e.: generating >>>>>>> python stub code for web2py -- you can create a Python script that >>>>>>> loads the environment and extracts info as needed). >>>>>>> >>>>>>> See: http://pydev.org/manual_101_interpreter.html#id2 for details >>>>>>> >>>>>>> An example script that converts QScintilla .api files to the >>>>>>> predefined completions is available at: >>>>>>> https://github.com/aptana/Pydev/blob/master/plugins/org.python.pydev.jython/jysrc/convert_api_to_pypredef.py >>>>>>> (this file should also be in your local PyDev) >>>>>>> >>>>>>> Cheers, >>>>>>> >>>>>>> Fabio >>>>>>> >>>>>>> On Thu, Apr 28, 2011 at 9:36 AM, Álvaro J. Iradier <air...@gm...> wrote: >>>>>>>> Hi all, >>>>>>>> >>>>>>>> I'm trying to make a Jython Script for Pydev for better integration >>>>>>>> with web2py development. >>>>>>>> >>>>>>>> Basically, I need some way to access the python interpreter that is >>>>>>>> used for syntax check and code completion from the jython script. >>>>>>>> >>>>>>>> What I would like to do is, when a .py file for a web2py project is >>>>>>>> loaded in the editor, fist, make some imports into the current >>>>>>>> interpreter, for example: >>>>>>>> >>>>>>>> from gluon.globals import Request >>>>>>>> from gluon.globals import Session >>>>>>>> from gluon.globals import Response >>>>>>>> >>>>>>>> then instantiate some of this classes into global variables: >>>>>>>> >>>>>>>> request=Request() >>>>>>>> session=Session() >>>>>>>> response=Response() >>>>>>>> >>>>>>>> to simulate a real request environment. >>>>>>>> >>>>>>>> Finally, I want to "exec" all the files in the models/ folder, in >>>>>>>> order to have the globals declared in there into de interpreter. >>>>>>>> >>>>>>>> Can you guide me into the right path? I'm totally lost looking at the >>>>>>>> code in com.python.pydev.codecompletion... I don't know how to get >>>>>>>> there from the jython script (or even if it's possible). >>>>>>>> >>>>>>>> Thanks very much. >>>>>>>> >>>>>>>> -- >>>>>>>> >>>>>>>> (:=================================:) >>>>>>>> Alvaro J. Iradier Muro - air...@gm... >>>>>>>> >>>>>>>> ------------------------------------------------------------------------------ >>>>>>>> WhatsUp Gold - Download Free Network Management Software >>>>>>>> The most intuitive, comprehensive, and cost-effective network >>>>>>>> management toolset available today. Delivers lowest initial >>>>>>>> acquisition cost and overall TCO of any competing solution. >>>>>>>> http://p.sf.net/sfu/whatsupgold-sd >>>>>>>> _______________________________________________ >>>>>>>> pydev-code mailing list >>>>>>>> pyd...@li... >>>>>>>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>>>>>>> >>>>>>> >>>>>>> ------------------------------------------------------------------------------ >>>>>>> WhatsUp Gold - Download Free Network Management Software >>>>>>> The most intuitive, comprehensive, and cost-effective network >>>>>>> management toolset available today. Delivers lowest initial >>>>>>> acquisition cost and overall TCO of any competing solution. >>>>>>> http://p.sf.net/sfu/whatsupgold-sd >>>>>>> _______________________________________________ >>>>>>> pydev-code mailing list >>>>>>> pyd...@li... >>>>>>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> (:=================================:) >>>>>> Alvaro J. Iradier Muro - air...@gm... >>>>>> >>>>>> ------------------------------------------------------------------------------ >>>>>> WhatsUp Gold - Download Free Network Management Software >>>>>> The most intuitive, comprehensive, and cost-effective network >>>>>> management toolset available today. Delivers lowest initial >>>>>> acquisition cost and overall TCO of any competing solution. >>>>>> http://p.sf.net/sfu/whatsupgold-sd >>>>>> _______________________________________________ >>>>>> pydev-code mailing list >>>>>> pyd...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> WhatsUp Gold - Download Free Network Management Software >>>>> The most intuitive, comprehensive, and cost-effective network >>>>> management toolset available today. Delivers lowest initial >>>>> acquisition cost and overall TCO of any competing solution. >>>>> http://p.sf.net/sfu/whatsupgold-sd >>>>> _______________________________________________ >>>>> pydev-code mailing list >>>>> pyd...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>>>> >>>> >>>> >>>> >>>> -- >>>> (:=================================:) >>>> Alvaro J. Iradier Muro - air...@gm... >>>> >>>> ------------------------------------------------------------------------------ >>>> WhatsUp Gold - Download Free Network Management Software >>>> The most intuitive, comprehensive, and cost-effective network >>>> management toolset available today. Delivers lowest initial >>>> acquisition cost and overall TCO of any competing solution. >>>> http://p.sf.net/sfu/whatsupgold-sd >>>> _______________________________________________ >>>> pydev-code mailing list >>>> pyd...@li... >>>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>>> >>> >>> ------------------------------------------------------------------------------ >>> WhatsUp Gold - Download Free Network Management Software >>> The most intuitive, comprehensive, and cost-effective network >>> management toolset available today. Delivers lowest initial >>> acquisition cost and overall TCO of any competing solution. >>> http://p.sf.net/sfu/whatsupgold-sd >>> _______________________________________________ >>> pydev-code mailing list >>> pyd...@li... >>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>> >> >> >> >> -- >> (:=================================:) >> Alvaro J. Iradier Muro - air...@gm... >> > > > > -- > (:=================================:) > Alvaro J. Iradier Muro - air...@gm... > > ------------------------------------------------------------------------------ > vRanger cuts backup time in half-while increasing security. > With the market-leading solution for virtual backup and recovery, > you get blazing-fast, flexible, and affordable data protection. > Download your free trial now. > http://p.sf.net/sfu/quest-d2dcopy1 > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > |
From: Florian G. <jer...@gm...> - 2011-05-24 12:41:06
|
Hi PyDev devs, I'm a user of nose-of-yeti (noy) [0] which is a tool that can be used together with tools like nose, lettuce, freshen, should_dsl, etc. to create a bdd environment similar to cucumber/rspec in ruby. PyDev mostly supports this already. There's only one catch: nose-of-yeti requires a custom codec for spec files which is not supported by PyDev. This means that valid noy .spec files are not recognized which leads to incompatibilities in the PyDev debugger [1] and editor [2]. I'm currently working around the debugger problem with the patch described in [1]. But I couldn't solve the editor problem which is more complex. To fully support noy, PyDev would have to: 1) Apply the patch in [1] 2) Either support non-default codecs in general - which is probably a good thing in it's own right - or support the 'spec' codec specifically. 1) will probably be unnecessary if the 'spec' encoding is generally supported. 2) I've written a small script that can be included in sitecustomize.py to register the spec if you want to try it out with PyDev, see attachment. I hope someone on your side is interested to support me in this. Thanks, Florian [0] https://bitbucket.org/delfick/nose-of-yeti/overview [1] see https://bitbucket.org/delfick/nose-of-yeti/src/2866fc497e5b/README.rst [2] throwing java.io.UnsupportedEncodingException: The encoding found: >>spec<< on python/hrs/specs/test_messaging.py is not a valid encoding. at org.python.pydev.core.REF.getValidEncoding(REF.java:920) and therefore not decoding the file correctly even when the codec is correctly registered via sitecustomize.py or usercustomize.py. |
From: Álvaro J. I. <air...@gm...> - 2011-05-24 12:32:20
|
Hi Fabio, did you get some time to check and give us some ideas on how to start this web2py support using predefined completions? Thanks, and sorry for insisting. On Fri, Apr 29, 2011 at 1:43 PM, Álvaro J. Iradier <air...@gm...> wrote: > It sounds better than OK, thanks very much,. > > Request ID 3294887 > > https://sourceforge.net/tracker/?func=detail&aid=3294887&group_id=85796&atid=577332 > > Greets. > > On Fri, Apr 29, 2011 at 12:39 PM, Fabio Zadrozny <fa...@gm...> wrote: >> Hi Alvaro, >> >> I think that almost all there can be done with the predefined >> completions... Let's do the following: Create a feature request and >> attach the sample project from your web2py_example, from there, I'll >> start providing the initial structure and will give you the next steps >> and we can go from there... does that sound OK for you? >> >> Cheers, >> >> Fabio >> >> On Fri, Apr 29, 2011 at 5:46 AM, Álvaro J. Iradier <air...@gm...> wrote: >>> Hi Fabio, I don't know if you're familiar with web2py, I'll try to >>> give you an example. >>> >>> Project in Eclipse: web2py_example >>> >>> Structure: >>> --------------------------------------- >>> web2py_example >>> src/ >>> cache/ >>> controllers/ >>> default.py >>> cron/ >>> databases/ >>> errors/ >>> languages/ >>> models/ >>> config.py >>> db.py >>> db_functions.py >>> db_models.py >>> db_others.py >>> mail.py >>> menu.py >>> version.py >>> modules/ >>> ... >>> .project >>> .pydevproject >>> --------------------------------------- >>> >>> The 'src' folder is linked to the web2py application folder, for >>> example, src-> c:\web2py\applications\my_application. Some examples of >>> files: >>> >>> models/db.py: >>> ------------------------------------------------ >>> # coding: utf8 >>> db = DAL('sqlite://storage.sqlite') >>> ... >>> ------------------------------------------------ >>> >>> models/db_functions.py: >>> ------------------------------------------------ >>> # coding: utf8 >>> >>> DATETIME_FORMAT = "%d/%m/%Y %H:%M:%S" >>> >>> def get_latest_sample_date(): >>> maxID = db.sensor_samples.id.max() >>> ... >>> ------------------------------------------------ >>> >>> models/menu.py: >>> ------------------------------------------------ >>> response.title = request.application >>> >>> if request.function == 'somefunction': >>> response.menu = ... >>> else: >>> response.menu = ... >>> ... >>> ------------------------------------------------ >>> >>> >>> controllers/default.py: >>> ------------------------------------------------ >>> @auth.requires_login() >>> def index(): >>> time = datetime.now().strftime(DATETIME_FORMAT) >>> latest = get_latest_sample_date() >>> response.flash = 'Sample message' >>> >>> return dict( >>> time=time, >>> latestSample=latest) >>> ... >>> ------------------------------------------------ >>> >>> On web2py, the code for function 'index' on controllers/default.py is >>> run when you navigate to http://server/my_application/deafult/index. >>> >>> Web2py "magically" populates an environment, so some instances like >>> 'request', 'response', 'session', and some modules and classes are >>> imported. Then, web2py evals all the files in the models/ folder. >>> Finally, it evals the controllers/default.py file, and calls the >>> 'index' function (the returned dictionary is passed to the >>> corresponding view, but that doesn't matter right now). >>> >>> So, what do I want to achieve? >>> >>> When editing a file in models/ (for example models/db.py), I would >>> like pydev to know about that DAL was imported from gluon.dal.DAL >>> (web2py does it automatically). >>> >>> Then, in models/db_functions.py I would like pydev to know about the >>> 'db' variable, which was created in modles/db.py (web2py evaluates >>> these files in alphabetical order, so db.py comes befure >>> db_functions.py). >>> >>> Also in models/menu.py, I would like pydev to know that request and >>> response are instances of gluon.globals.Request and >>> gluon.globals.Response respectively, etc. >>> >>> When editing the file controlles/default.py, I'd like web2py to know >>> about 'request', 'response' (and some others), as well as about the >>> declarations in all the models/ file (in the code example, I'm calling >>> the 'get_latest_sample_date' function declared in >>> models/db_functions.py) >>> >>> Basically, I want to setup the environment in a similar way to what is >>> done by web2py in gluon.compilyapp, functions 'build_environment' and >>> 'run_models': >>> >>> ------------------------------------- >>> def build_environment(request, response, session): >>> """ >>> Build the environment dictionary into which web2py files are executed. >>> """ >>> >>> environment = {} >>> for key in html.__all__: >>> environment[key] = getattr(html, key) >>> >>> # Overwrite the URL function with a proxy >>> # url function which contains this request. >>> environment['URL'] = html._gURL(request) >>> >>> for key in validators.__all__: >>> environment[key] = getattr(validators, key) >>> if not request.env: >>> request.env = Storage() >>> environment['T'] = translator(request) >>> environment['HTTP'] = HTTP >>> environment['redirect'] = redirect >>> environment['request'] = request >>> environment['response'] = response >>> environment['session'] = session >>> environment['cache'] = Cache(request) >>> environment['DAL'] = DAL >>> environment['Field'] = Field >>> environment['SQLDB'] = SQLDB # for backward compatibility >>> environment['SQLField'] = SQLField # for backward compatibility >>> environment['SQLFORM'] = SQLFORM >>> environment['SQLTABLE'] = SQLTABLE >>> environment['LOAD'] = LoadFactory(environment) >>> environment['local_import'] = \ >>> lambda name, reload=False, app=request.application:\ >>> local_import_aux(name,reload,app) >>> BaseAdapter.set_folder(os.path.join(request.folder, 'databases')) >>> response._view_environment = copy.copy(environment) >>> return environment >>> >>> def run_models_in(environment): >>> """ >>> Runs all models (in the app specified by the current folder) >>> It tries pre-compiled models first before compiling them. >>> """ >>> >>> folder = environment['request'].folder >>> path = os.path.join(folder, 'compiled') >>> if os.path.exists(path): >>> for model in listdir(path, '^models_.+\.pyc$', 0): >>> restricted(read_pyc(model), environment, layer=model) >>> else: >>> models = listdir(os.path.join(folder, 'models'), '^\w+\.py$', >>> 0) >>> for model in models: >>> layer = model >>> if is_gae: >>> code = getcfs(model, model, >>> lambda: compile2(open(model, 'r').read(),layer)) >>> else: >>> code = getcfs(model, model, None) >>> restricted(code, environment, layer) >>> >>> ------------------------------------- >>> >>> So, do you think this can be done just with scripting, or will it >>> require extending pydev? >>> >>> Suggestions are welcome, and I think web2py developers would find this >>> very useful. >>> >>> Greets. >>> >>> On Thu, Apr 28, 2011 at 3:32 PM, Fabio Zadrozny <fa...@es...> wrote: >>>> On Thu, Apr 28, 2011 at 10:18 AM, Álvaro J. Iradier <air...@gm...> wrote: >>>>> That might work for predefined classes or items, like "request", >>>>> "response", "session"..., but I want to go further. I want to >>>>> dinamically parse the files in models/, which define some variables >>>>> and functions, and I want to make those available too. >>>>> >>>>> Is it possible to get this far using the jython scripting, or should I >>>>> develop a plugin or a patch for pydev? >>>>> >>>> >>>> Can you give an actual example with code on what you want to achieve? >>>> >>>> Cheers, >>>> >>>> Fabio >>>> >>>> >>>>> Greets. >>>>> >>>>> On Thu, Apr 28, 2011 at 3:07 PM, Fabio Zadrozny <fab...@gm...> wrote: >>>>>> Might be easier providing predefined completions (i.e.: generating >>>>>> python stub code for web2py -- you can create a Python script that >>>>>> loads the environment and extracts info as needed). >>>>>> >>>>>> See: http://pydev.org/manual_101_interpreter.html#id2 for details >>>>>> >>>>>> An example script that converts QScintilla .api files to the >>>>>> predefined completions is available at: >>>>>> https://github.com/aptana/Pydev/blob/master/plugins/org.python.pydev.jython/jysrc/convert_api_to_pypredef.py >>>>>> (this file should also be in your local PyDev) >>>>>> >>>>>> Cheers, >>>>>> >>>>>> Fabio >>>>>> >>>>>> On Thu, Apr 28, 2011 at 9:36 AM, Álvaro J. Iradier <air...@gm...> wrote: >>>>>>> Hi all, >>>>>>> >>>>>>> I'm trying to make a Jython Script for Pydev for better integration >>>>>>> with web2py development. >>>>>>> >>>>>>> Basically, I need some way to access the python interpreter that is >>>>>>> used for syntax check and code completion from the jython script. >>>>>>> >>>>>>> What I would like to do is, when a .py file for a web2py project is >>>>>>> loaded in the editor, fist, make some imports into the current >>>>>>> interpreter, for example: >>>>>>> >>>>>>> from gluon.globals import Request >>>>>>> from gluon.globals import Session >>>>>>> from gluon.globals import Response >>>>>>> >>>>>>> then instantiate some of this classes into global variables: >>>>>>> >>>>>>> request=Request() >>>>>>> session=Session() >>>>>>> response=Response() >>>>>>> >>>>>>> to simulate a real request environment. >>>>>>> >>>>>>> Finally, I want to "exec" all the files in the models/ folder, in >>>>>>> order to have the globals declared in there into de interpreter. >>>>>>> >>>>>>> Can you guide me into the right path? I'm totally lost looking at the >>>>>>> code in com.python.pydev.codecompletion... I don't know how to get >>>>>>> there from the jython script (or even if it's possible). >>>>>>> >>>>>>> Thanks very much. >>>>>>> >>>>>>> -- >>>>>>> >>>>>>> (:=================================:) >>>>>>> Alvaro J. Iradier Muro - air...@gm... >>>>>>> >>>>>>> ------------------------------------------------------------------------------ >>>>>>> WhatsUp Gold - Download Free Network Management Software >>>>>>> The most intuitive, comprehensive, and cost-effective network >>>>>>> management toolset available today. Delivers lowest initial >>>>>>> acquisition cost and overall TCO of any competing solution. >>>>>>> http://p.sf.net/sfu/whatsupgold-sd >>>>>>> _______________________________________________ >>>>>>> pydev-code mailing list >>>>>>> pyd...@li... >>>>>>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>>>>>> >>>>>> >>>>>> ------------------------------------------------------------------------------ >>>>>> WhatsUp Gold - Download Free Network Management Software >>>>>> The most intuitive, comprehensive, and cost-effective network >>>>>> management toolset available today. Delivers lowest initial >>>>>> acquisition cost and overall TCO of any competing solution. >>>>>> http://p.sf.net/sfu/whatsupgold-sd >>>>>> _______________________________________________ >>>>>> pydev-code mailing list >>>>>> pyd...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> (:=================================:) >>>>> Alvaro J. Iradier Muro - air...@gm... >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> WhatsUp Gold - Download Free Network Management Software >>>>> The most intuitive, comprehensive, and cost-effective network >>>>> management toolset available today. Delivers lowest initial >>>>> acquisition cost and overall TCO of any competing solution. >>>>> http://p.sf.net/sfu/whatsupgold-sd >>>>> _______________________________________________ >>>>> pydev-code mailing list >>>>> pyd...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> WhatsUp Gold - Download Free Network Management Software >>>> The most intuitive, comprehensive, and cost-effective network >>>> management toolset available today. Delivers lowest initial >>>> acquisition cost and overall TCO of any competing solution. >>>> http://p.sf.net/sfu/whatsupgold-sd >>>> _______________________________________________ >>>> pydev-code mailing list >>>> pyd...@li... >>>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>>> >>> >>> >>> >>> -- >>> (:=================================:) >>> Alvaro J. Iradier Muro - air...@gm... >>> >>> ------------------------------------------------------------------------------ >>> WhatsUp Gold - Download Free Network Management Software >>> The most intuitive, comprehensive, and cost-effective network >>> management toolset available today. Delivers lowest initial >>> acquisition cost and overall TCO of any competing solution. >>> http://p.sf.net/sfu/whatsupgold-sd >>> _______________________________________________ >>> pydev-code mailing list >>> pyd...@li... >>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>> >> >> ------------------------------------------------------------------------------ >> WhatsUp Gold - Download Free Network Management Software >> The most intuitive, comprehensive, and cost-effective network >> management toolset available today. Delivers lowest initial >> acquisition cost and overall TCO of any competing solution. >> http://p.sf.net/sfu/whatsupgold-sd >> _______________________________________________ >> pydev-code mailing list >> pyd...@li... >> https://lists.sourceforge.net/lists/listinfo/pydev-code >> > > > > -- > (:=================================:) > Alvaro J. Iradier Muro - air...@gm... > -- (:=================================:) Alvaro J. Iradier Muro - air...@gm... |
From: j b. k. <jbr...@gm...> - 2011-05-12 20:10:43
|
ok...i restarted eclipse and things are mysteriously back to normal...so never mind.... brandon On Thu, May 12, 2011 at 11:07 AM, j brandon keith <jbr...@gm...>wrote: > Hi, I've been using pydev happily for years but somehow it has started an > annoying behavior: every time I debug, instead of showing the console where > standard out/err go and which has the relaunch button, it switches to some > "debug console" where I no longer have that relaunch/stop button. Is there > a way to stop this behavior and keep the original console? thanks... > > brandon > > > > |
From: j b. k. <jbr...@gm...> - 2011-05-12 18:07:31
|
Hi, I've been using pydev happily for years but somehow it has started an annoying behavior: every time I debug, instead of showing the console where standard out/err go and which has the relaunch button, it switches to some "debug console" where I no longer have that relaunch/stop button. Is there a way to stop this behavior and keep the original console? thanks... brandon |
From: Álvaro J. I. <air...@gm...> - 2011-04-29 11:44:10
|
It sounds better than OK, thanks very much,. Request ID 3294887 https://sourceforge.net/tracker/?func=detail&aid=3294887&group_id=85796&atid=577332 Greets. On Fri, Apr 29, 2011 at 12:39 PM, Fabio Zadrozny <fa...@gm...> wrote: > Hi Alvaro, > > I think that almost all there can be done with the predefined > completions... Let's do the following: Create a feature request and > attach the sample project from your web2py_example, from there, I'll > start providing the initial structure and will give you the next steps > and we can go from there... does that sound OK for you? > > Cheers, > > Fabio > > On Fri, Apr 29, 2011 at 5:46 AM, Álvaro J. Iradier <air...@gm...> wrote: >> Hi Fabio, I don't know if you're familiar with web2py, I'll try to >> give you an example. >> >> Project in Eclipse: web2py_example >> >> Structure: >> --------------------------------------- >> web2py_example >> src/ >> cache/ >> controllers/ >> default.py >> cron/ >> databases/ >> errors/ >> languages/ >> models/ >> config.py >> db.py >> db_functions.py >> db_models.py >> db_others.py >> mail.py >> menu.py >> version.py >> modules/ >> ... >> .project >> .pydevproject >> --------------------------------------- >> >> The 'src' folder is linked to the web2py application folder, for >> example, src-> c:\web2py\applications\my_application. Some examples of >> files: >> >> models/db.py: >> ------------------------------------------------ >> # coding: utf8 >> db = DAL('sqlite://storage.sqlite') >> ... >> ------------------------------------------------ >> >> models/db_functions.py: >> ------------------------------------------------ >> # coding: utf8 >> >> DATETIME_FORMAT = "%d/%m/%Y %H:%M:%S" >> >> def get_latest_sample_date(): >> maxID = db.sensor_samples.id.max() >> ... >> ------------------------------------------------ >> >> models/menu.py: >> ------------------------------------------------ >> response.title = request.application >> >> if request.function == 'somefunction': >> response.menu = ... >> else: >> response.menu = ... >> ... >> ------------------------------------------------ >> >> >> controllers/default.py: >> ------------------------------------------------ >> @auth.requires_login() >> def index(): >> time = datetime.now().strftime(DATETIME_FORMAT) >> latest = get_latest_sample_date() >> response.flash = 'Sample message' >> >> return dict( >> time=time, >> latestSample=latest) >> ... >> ------------------------------------------------ >> >> On web2py, the code for function 'index' on controllers/default.py is >> run when you navigate to http://server/my_application/deafult/index. >> >> Web2py "magically" populates an environment, so some instances like >> 'request', 'response', 'session', and some modules and classes are >> imported. Then, web2py evals all the files in the models/ folder. >> Finally, it evals the controllers/default.py file, and calls the >> 'index' function (the returned dictionary is passed to the >> corresponding view, but that doesn't matter right now). >> >> So, what do I want to achieve? >> >> When editing a file in models/ (for example models/db.py), I would >> like pydev to know about that DAL was imported from gluon.dal.DAL >> (web2py does it automatically). >> >> Then, in models/db_functions.py I would like pydev to know about the >> 'db' variable, which was created in modles/db.py (web2py evaluates >> these files in alphabetical order, so db.py comes befure >> db_functions.py). >> >> Also in models/menu.py, I would like pydev to know that request and >> response are instances of gluon.globals.Request and >> gluon.globals.Response respectively, etc. >> >> When editing the file controlles/default.py, I'd like web2py to know >> about 'request', 'response' (and some others), as well as about the >> declarations in all the models/ file (in the code example, I'm calling >> the 'get_latest_sample_date' function declared in >> models/db_functions.py) >> >> Basically, I want to setup the environment in a similar way to what is >> done by web2py in gluon.compilyapp, functions 'build_environment' and >> 'run_models': >> >> ------------------------------------- >> def build_environment(request, response, session): >> """ >> Build the environment dictionary into which web2py files are executed. >> """ >> >> environment = {} >> for key in html.__all__: >> environment[key] = getattr(html, key) >> >> # Overwrite the URL function with a proxy >> # url function which contains this request. >> environment['URL'] = html._gURL(request) >> >> for key in validators.__all__: >> environment[key] = getattr(validators, key) >> if not request.env: >> request.env = Storage() >> environment['T'] = translator(request) >> environment['HTTP'] = HTTP >> environment['redirect'] = redirect >> environment['request'] = request >> environment['response'] = response >> environment['session'] = session >> environment['cache'] = Cache(request) >> environment['DAL'] = DAL >> environment['Field'] = Field >> environment['SQLDB'] = SQLDB # for backward compatibility >> environment['SQLField'] = SQLField # for backward compatibility >> environment['SQLFORM'] = SQLFORM >> environment['SQLTABLE'] = SQLTABLE >> environment['LOAD'] = LoadFactory(environment) >> environment['local_import'] = \ >> lambda name, reload=False, app=request.application:\ >> local_import_aux(name,reload,app) >> BaseAdapter.set_folder(os.path.join(request.folder, 'databases')) >> response._view_environment = copy.copy(environment) >> return environment >> >> def run_models_in(environment): >> """ >> Runs all models (in the app specified by the current folder) >> It tries pre-compiled models first before compiling them. >> """ >> >> folder = environment['request'].folder >> path = os.path.join(folder, 'compiled') >> if os.path.exists(path): >> for model in listdir(path, '^models_.+\.pyc$', 0): >> restricted(read_pyc(model), environment, layer=model) >> else: >> models = listdir(os.path.join(folder, 'models'), '^\w+\.py$', >> 0) >> for model in models: >> layer = model >> if is_gae: >> code = getcfs(model, model, >> lambda: compile2(open(model, 'r').read(),layer)) >> else: >> code = getcfs(model, model, None) >> restricted(code, environment, layer) >> >> ------------------------------------- >> >> So, do you think this can be done just with scripting, or will it >> require extending pydev? >> >> Suggestions are welcome, and I think web2py developers would find this >> very useful. >> >> Greets. >> >> On Thu, Apr 28, 2011 at 3:32 PM, Fabio Zadrozny <fa...@es...> wrote: >>> On Thu, Apr 28, 2011 at 10:18 AM, Álvaro J. Iradier <air...@gm...> wrote: >>>> That might work for predefined classes or items, like "request", >>>> "response", "session"..., but I want to go further. I want to >>>> dinamically parse the files in models/, which define some variables >>>> and functions, and I want to make those available too. >>>> >>>> Is it possible to get this far using the jython scripting, or should I >>>> develop a plugin or a patch for pydev? >>>> >>> >>> Can you give an actual example with code on what you want to achieve? >>> >>> Cheers, >>> >>> Fabio >>> >>> >>>> Greets. >>>> >>>> On Thu, Apr 28, 2011 at 3:07 PM, Fabio Zadrozny <fab...@gm...> wrote: >>>>> Might be easier providing predefined completions (i.e.: generating >>>>> python stub code for web2py -- you can create a Python script that >>>>> loads the environment and extracts info as needed). >>>>> >>>>> See: http://pydev.org/manual_101_interpreter.html#id2 for details >>>>> >>>>> An example script that converts QScintilla .api files to the >>>>> predefined completions is available at: >>>>> https://github.com/aptana/Pydev/blob/master/plugins/org.python.pydev.jython/jysrc/convert_api_to_pypredef.py >>>>> (this file should also be in your local PyDev) >>>>> >>>>> Cheers, >>>>> >>>>> Fabio >>>>> >>>>> On Thu, Apr 28, 2011 at 9:36 AM, Álvaro J. Iradier <air...@gm...> wrote: >>>>>> Hi all, >>>>>> >>>>>> I'm trying to make a Jython Script for Pydev for better integration >>>>>> with web2py development. >>>>>> >>>>>> Basically, I need some way to access the python interpreter that is >>>>>> used for syntax check and code completion from the jython script. >>>>>> >>>>>> What I would like to do is, when a .py file for a web2py project is >>>>>> loaded in the editor, fist, make some imports into the current >>>>>> interpreter, for example: >>>>>> >>>>>> from gluon.globals import Request >>>>>> from gluon.globals import Session >>>>>> from gluon.globals import Response >>>>>> >>>>>> then instantiate some of this classes into global variables: >>>>>> >>>>>> request=Request() >>>>>> session=Session() >>>>>> response=Response() >>>>>> >>>>>> to simulate a real request environment. >>>>>> >>>>>> Finally, I want to "exec" all the files in the models/ folder, in >>>>>> order to have the globals declared in there into de interpreter. >>>>>> >>>>>> Can you guide me into the right path? I'm totally lost looking at the >>>>>> code in com.python.pydev.codecompletion... I don't know how to get >>>>>> there from the jython script (or even if it's possible). >>>>>> >>>>>> Thanks very much. >>>>>> >>>>>> -- >>>>>> >>>>>> (:=================================:) >>>>>> Alvaro J. Iradier Muro - air...@gm... >>>>>> >>>>>> ------------------------------------------------------------------------------ >>>>>> WhatsUp Gold - Download Free Network Management Software >>>>>> The most intuitive, comprehensive, and cost-effective network >>>>>> management toolset available today. Delivers lowest initial >>>>>> acquisition cost and overall TCO of any competing solution. >>>>>> http://p.sf.net/sfu/whatsupgold-sd >>>>>> _______________________________________________ >>>>>> pydev-code mailing list >>>>>> pyd...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> WhatsUp Gold - Download Free Network Management Software >>>>> The most intuitive, comprehensive, and cost-effective network >>>>> management toolset available today. Delivers lowest initial >>>>> acquisition cost and overall TCO of any competing solution. >>>>> http://p.sf.net/sfu/whatsupgold-sd >>>>> _______________________________________________ >>>>> pydev-code mailing list >>>>> pyd...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>>>> >>>> >>>> >>>> >>>> -- >>>> (:=================================:) >>>> Alvaro J. Iradier Muro - air...@gm... >>>> >>>> ------------------------------------------------------------------------------ >>>> WhatsUp Gold - Download Free Network Management Software >>>> The most intuitive, comprehensive, and cost-effective network >>>> management toolset available today. Delivers lowest initial >>>> acquisition cost and overall TCO of any competing solution. >>>> http://p.sf.net/sfu/whatsupgold-sd >>>> _______________________________________________ >>>> pydev-code mailing list >>>> pyd...@li... >>>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>>> >>> >>> ------------------------------------------------------------------------------ >>> WhatsUp Gold - Download Free Network Management Software >>> The most intuitive, comprehensive, and cost-effective network >>> management toolset available today. Delivers lowest initial >>> acquisition cost and overall TCO of any competing solution. >>> http://p.sf.net/sfu/whatsupgold-sd >>> _______________________________________________ >>> pydev-code mailing list >>> pyd...@li... >>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>> >> >> >> >> -- >> (:=================================:) >> Alvaro J. Iradier Muro - air...@gm... >> >> ------------------------------------------------------------------------------ >> WhatsUp Gold - Download Free Network Management Software >> The most intuitive, comprehensive, and cost-effective network >> management toolset available today. Delivers lowest initial >> acquisition cost and overall TCO of any competing solution. >> http://p.sf.net/sfu/whatsupgold-sd >> _______________________________________________ >> pydev-code mailing list >> pyd...@li... >> https://lists.sourceforge.net/lists/listinfo/pydev-code >> > > ------------------------------------------------------------------------------ > WhatsUp Gold - Download Free Network Management Software > The most intuitive, comprehensive, and cost-effective network > management toolset available today. Delivers lowest initial > acquisition cost and overall TCO of any competing solution. > http://p.sf.net/sfu/whatsupgold-sd > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > -- (:=================================:) Alvaro J. Iradier Muro - air...@gm... |
From: Fabio Z. <fa...@gm...> - 2011-04-29 10:40:03
|
Hi Alvaro, I think that almost all there can be done with the predefined completions... Let's do the following: Create a feature request and attach the sample project from your web2py_example, from there, I'll start providing the initial structure and will give you the next steps and we can go from there... does that sound OK for you? Cheers, Fabio On Fri, Apr 29, 2011 at 5:46 AM, Álvaro J. Iradier <air...@gm...> wrote: > Hi Fabio, I don't know if you're familiar with web2py, I'll try to > give you an example. > > Project in Eclipse: web2py_example > > Structure: > --------------------------------------- > web2py_example > src/ > cache/ > controllers/ > default.py > cron/ > databases/ > errors/ > languages/ > models/ > config.py > db.py > db_functions.py > db_models.py > db_others.py > mail.py > menu.py > version.py > modules/ > ... > .project > .pydevproject > --------------------------------------- > > The 'src' folder is linked to the web2py application folder, for > example, src-> c:\web2py\applications\my_application. Some examples of > files: > > models/db.py: > ------------------------------------------------ > # coding: utf8 > db = DAL('sqlite://storage.sqlite') > ... > ------------------------------------------------ > > models/db_functions.py: > ------------------------------------------------ > # coding: utf8 > > DATETIME_FORMAT = "%d/%m/%Y %H:%M:%S" > > def get_latest_sample_date(): > maxID = db.sensor_samples.id.max() > ... > ------------------------------------------------ > > models/menu.py: > ------------------------------------------------ > response.title = request.application > > if request.function == 'somefunction': > response.menu = ... > else: > response.menu = ... > ... > ------------------------------------------------ > > > controllers/default.py: > ------------------------------------------------ > @auth.requires_login() > def index(): > time = datetime.now().strftime(DATETIME_FORMAT) > latest = get_latest_sample_date() > response.flash = 'Sample message' > > return dict( > time=time, > latestSample=latest) > ... > ------------------------------------------------ > > On web2py, the code for function 'index' on controllers/default.py is > run when you navigate to http://server/my_application/deafult/index. > > Web2py "magically" populates an environment, so some instances like > 'request', 'response', 'session', and some modules and classes are > imported. Then, web2py evals all the files in the models/ folder. > Finally, it evals the controllers/default.py file, and calls the > 'index' function (the returned dictionary is passed to the > corresponding view, but that doesn't matter right now). > > So, what do I want to achieve? > > When editing a file in models/ (for example models/db.py), I would > like pydev to know about that DAL was imported from gluon.dal.DAL > (web2py does it automatically). > > Then, in models/db_functions.py I would like pydev to know about the > 'db' variable, which was created in modles/db.py (web2py evaluates > these files in alphabetical order, so db.py comes befure > db_functions.py). > > Also in models/menu.py, I would like pydev to know that request and > response are instances of gluon.globals.Request and > gluon.globals.Response respectively, etc. > > When editing the file controlles/default.py, I'd like web2py to know > about 'request', 'response' (and some others), as well as about the > declarations in all the models/ file (in the code example, I'm calling > the 'get_latest_sample_date' function declared in > models/db_functions.py) > > Basically, I want to setup the environment in a similar way to what is > done by web2py in gluon.compilyapp, functions 'build_environment' and > 'run_models': > > ------------------------------------- > def build_environment(request, response, session): > """ > Build the environment dictionary into which web2py files are executed. > """ > > environment = {} > for key in html.__all__: > environment[key] = getattr(html, key) > > # Overwrite the URL function with a proxy > # url function which contains this request. > environment['URL'] = html._gURL(request) > > for key in validators.__all__: > environment[key] = getattr(validators, key) > if not request.env: > request.env = Storage() > environment['T'] = translator(request) > environment['HTTP'] = HTTP > environment['redirect'] = redirect > environment['request'] = request > environment['response'] = response > environment['session'] = session > environment['cache'] = Cache(request) > environment['DAL'] = DAL > environment['Field'] = Field > environment['SQLDB'] = SQLDB # for backward compatibility > environment['SQLField'] = SQLField # for backward compatibility > environment['SQLFORM'] = SQLFORM > environment['SQLTABLE'] = SQLTABLE > environment['LOAD'] = LoadFactory(environment) > environment['local_import'] = \ > lambda name, reload=False, app=request.application:\ > local_import_aux(name,reload,app) > BaseAdapter.set_folder(os.path.join(request.folder, 'databases')) > response._view_environment = copy.copy(environment) > return environment > > def run_models_in(environment): > """ > Runs all models (in the app specified by the current folder) > It tries pre-compiled models first before compiling them. > """ > > folder = environment['request'].folder > path = os.path.join(folder, 'compiled') > if os.path.exists(path): > for model in listdir(path, '^models_.+\.pyc$', 0): > restricted(read_pyc(model), environment, layer=model) > else: > models = listdir(os.path.join(folder, 'models'), '^\w+\.py$', > 0) > for model in models: > layer = model > if is_gae: > code = getcfs(model, model, > lambda: compile2(open(model, 'r').read(),layer)) > else: > code = getcfs(model, model, None) > restricted(code, environment, layer) > > ------------------------------------- > > So, do you think this can be done just with scripting, or will it > require extending pydev? > > Suggestions are welcome, and I think web2py developers would find this > very useful. > > Greets. > > On Thu, Apr 28, 2011 at 3:32 PM, Fabio Zadrozny <fa...@es...> wrote: >> On Thu, Apr 28, 2011 at 10:18 AM, Álvaro J. Iradier <air...@gm...> wrote: >>> That might work for predefined classes or items, like "request", >>> "response", "session"..., but I want to go further. I want to >>> dinamically parse the files in models/, which define some variables >>> and functions, and I want to make those available too. >>> >>> Is it possible to get this far using the jython scripting, or should I >>> develop a plugin or a patch for pydev? >>> >> >> Can you give an actual example with code on what you want to achieve? >> >> Cheers, >> >> Fabio >> >> >>> Greets. >>> >>> On Thu, Apr 28, 2011 at 3:07 PM, Fabio Zadrozny <fab...@gm...> wrote: >>>> Might be easier providing predefined completions (i.e.: generating >>>> python stub code for web2py -- you can create a Python script that >>>> loads the environment and extracts info as needed). >>>> >>>> See: http://pydev.org/manual_101_interpreter.html#id2 for details >>>> >>>> An example script that converts QScintilla .api files to the >>>> predefined completions is available at: >>>> https://github.com/aptana/Pydev/blob/master/plugins/org.python.pydev.jython/jysrc/convert_api_to_pypredef.py >>>> (this file should also be in your local PyDev) >>>> >>>> Cheers, >>>> >>>> Fabio >>>> >>>> On Thu, Apr 28, 2011 at 9:36 AM, Álvaro J. Iradier <air...@gm...> wrote: >>>>> Hi all, >>>>> >>>>> I'm trying to make a Jython Script for Pydev for better integration >>>>> with web2py development. >>>>> >>>>> Basically, I need some way to access the python interpreter that is >>>>> used for syntax check and code completion from the jython script. >>>>> >>>>> What I would like to do is, when a .py file for a web2py project is >>>>> loaded in the editor, fist, make some imports into the current >>>>> interpreter, for example: >>>>> >>>>> from gluon.globals import Request >>>>> from gluon.globals import Session >>>>> from gluon.globals import Response >>>>> >>>>> then instantiate some of this classes into global variables: >>>>> >>>>> request=Request() >>>>> session=Session() >>>>> response=Response() >>>>> >>>>> to simulate a real request environment. >>>>> >>>>> Finally, I want to "exec" all the files in the models/ folder, in >>>>> order to have the globals declared in there into de interpreter. >>>>> >>>>> Can you guide me into the right path? I'm totally lost looking at the >>>>> code in com.python.pydev.codecompletion... I don't know how to get >>>>> there from the jython script (or even if it's possible). >>>>> >>>>> Thanks very much. >>>>> >>>>> -- >>>>> >>>>> (:=================================:) >>>>> Alvaro J. Iradier Muro - air...@gm... >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> WhatsUp Gold - Download Free Network Management Software >>>>> The most intuitive, comprehensive, and cost-effective network >>>>> management toolset available today. Delivers lowest initial >>>>> acquisition cost and overall TCO of any competing solution. >>>>> http://p.sf.net/sfu/whatsupgold-sd >>>>> _______________________________________________ >>>>> pydev-code mailing list >>>>> pyd...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> WhatsUp Gold - Download Free Network Management Software >>>> The most intuitive, comprehensive, and cost-effective network >>>> management toolset available today. Delivers lowest initial >>>> acquisition cost and overall TCO of any competing solution. >>>> http://p.sf.net/sfu/whatsupgold-sd >>>> _______________________________________________ >>>> pydev-code mailing list >>>> pyd...@li... >>>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>>> >>> >>> >>> >>> -- >>> (:=================================:) >>> Alvaro J. Iradier Muro - air...@gm... >>> >>> ------------------------------------------------------------------------------ >>> WhatsUp Gold - Download Free Network Management Software >>> The most intuitive, comprehensive, and cost-effective network >>> management toolset available today. Delivers lowest initial >>> acquisition cost and overall TCO of any competing solution. >>> http://p.sf.net/sfu/whatsupgold-sd >>> _______________________________________________ >>> pydev-code mailing list >>> pyd...@li... >>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>> >> >> ------------------------------------------------------------------------------ >> WhatsUp Gold - Download Free Network Management Software >> The most intuitive, comprehensive, and cost-effective network >> management toolset available today. Delivers lowest initial >> acquisition cost and overall TCO of any competing solution. >> http://p.sf.net/sfu/whatsupgold-sd >> _______________________________________________ >> pydev-code mailing list >> pyd...@li... >> https://lists.sourceforge.net/lists/listinfo/pydev-code >> > > > > -- > (:=================================:) > Alvaro J. Iradier Muro - air...@gm... > > ------------------------------------------------------------------------------ > WhatsUp Gold - Download Free Network Management Software > The most intuitive, comprehensive, and cost-effective network > management toolset available today. Delivers lowest initial > acquisition cost and overall TCO of any competing solution. > http://p.sf.net/sfu/whatsupgold-sd > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > |
From: Álvaro J. I. <air...@gm...> - 2011-04-29 08:47:10
|
Hi Fabio, I don't know if you're familiar with web2py, I'll try to give you an example. Project in Eclipse: web2py_example Structure: --------------------------------------- web2py_example src/ cache/ controllers/ default.py cron/ databases/ errors/ languages/ models/ config.py db.py db_functions.py db_models.py db_others.py mail.py menu.py version.py modules/ ... .project .pydevproject --------------------------------------- The 'src' folder is linked to the web2py application folder, for example, src-> c:\web2py\applications\my_application. Some examples of files: models/db.py: ------------------------------------------------ # coding: utf8 db = DAL('sqlite://storage.sqlite') ... ------------------------------------------------ models/db_functions.py: ------------------------------------------------ # coding: utf8 DATETIME_FORMAT = "%d/%m/%Y %H:%M:%S" def get_latest_sample_date(): maxID = db.sensor_samples.id.max() ... ------------------------------------------------ models/menu.py: ------------------------------------------------ response.title = request.application if request.function == 'somefunction': response.menu = ... else: response.menu = ... ... ------------------------------------------------ controllers/default.py: ------------------------------------------------ @auth.requires_login() def index(): time = datetime.now().strftime(DATETIME_FORMAT) latest = get_latest_sample_date() response.flash = 'Sample message' return dict( time=time, latestSample=latest) ... ------------------------------------------------ On web2py, the code for function 'index' on controllers/default.py is run when you navigate to http://server/my_application/deafult/index. Web2py "magically" populates an environment, so some instances like 'request', 'response', 'session', and some modules and classes are imported. Then, web2py evals all the files in the models/ folder. Finally, it evals the controllers/default.py file, and calls the 'index' function (the returned dictionary is passed to the corresponding view, but that doesn't matter right now). So, what do I want to achieve? When editing a file in models/ (for example models/db.py), I would like pydev to know about that DAL was imported from gluon.dal.DAL (web2py does it automatically). Then, in models/db_functions.py I would like pydev to know about the 'db' variable, which was created in modles/db.py (web2py evaluates these files in alphabetical order, so db.py comes befure db_functions.py). Also in models/menu.py, I would like pydev to know that request and response are instances of gluon.globals.Request and gluon.globals.Response respectively, etc. When editing the file controlles/default.py, I'd like web2py to know about 'request', 'response' (and some others), as well as about the declarations in all the models/ file (in the code example, I'm calling the 'get_latest_sample_date' function declared in models/db_functions.py) Basically, I want to setup the environment in a similar way to what is done by web2py in gluon.compilyapp, functions 'build_environment' and 'run_models': ------------------------------------- def build_environment(request, response, session): """ Build the environment dictionary into which web2py files are executed. """ environment = {} for key in html.__all__: environment[key] = getattr(html, key) # Overwrite the URL function with a proxy # url function which contains this request. environment['URL'] = html._gURL(request) for key in validators.__all__: environment[key] = getattr(validators, key) if not request.env: request.env = Storage() environment['T'] = translator(request) environment['HTTP'] = HTTP environment['redirect'] = redirect environment['request'] = request environment['response'] = response environment['session'] = session environment['cache'] = Cache(request) environment['DAL'] = DAL environment['Field'] = Field environment['SQLDB'] = SQLDB # for backward compatibility environment['SQLField'] = SQLField # for backward compatibility environment['SQLFORM'] = SQLFORM environment['SQLTABLE'] = SQLTABLE environment['LOAD'] = LoadFactory(environment) environment['local_import'] = \ lambda name, reload=False, app=request.application:\ local_import_aux(name,reload,app) BaseAdapter.set_folder(os.path.join(request.folder, 'databases')) response._view_environment = copy.copy(environment) return environment def run_models_in(environment): """ Runs all models (in the app specified by the current folder) It tries pre-compiled models first before compiling them. """ folder = environment['request'].folder path = os.path.join(folder, 'compiled') if os.path.exists(path): for model in listdir(path, '^models_.+\.pyc$', 0): restricted(read_pyc(model), environment, layer=model) else: models = listdir(os.path.join(folder, 'models'), '^\w+\.py$', 0) for model in models: layer = model if is_gae: code = getcfs(model, model, lambda: compile2(open(model, 'r').read(),layer)) else: code = getcfs(model, model, None) restricted(code, environment, layer) ------------------------------------- So, do you think this can be done just with scripting, or will it require extending pydev? Suggestions are welcome, and I think web2py developers would find this very useful. Greets. On Thu, Apr 28, 2011 at 3:32 PM, Fabio Zadrozny <fa...@es...> wrote: > On Thu, Apr 28, 2011 at 10:18 AM, Álvaro J. Iradier <air...@gm...> wrote: >> That might work for predefined classes or items, like "request", >> "response", "session"..., but I want to go further. I want to >> dinamically parse the files in models/, which define some variables >> and functions, and I want to make those available too. >> >> Is it possible to get this far using the jython scripting, or should I >> develop a plugin or a patch for pydev? >> > > Can you give an actual example with code on what you want to achieve? > > Cheers, > > Fabio > > >> Greets. >> >> On Thu, Apr 28, 2011 at 3:07 PM, Fabio Zadrozny <fab...@gm...> wrote: >>> Might be easier providing predefined completions (i.e.: generating >>> python stub code for web2py -- you can create a Python script that >>> loads the environment and extracts info as needed). >>> >>> See: http://pydev.org/manual_101_interpreter.html#id2 for details >>> >>> An example script that converts QScintilla .api files to the >>> predefined completions is available at: >>> https://github.com/aptana/Pydev/blob/master/plugins/org.python.pydev.jython/jysrc/convert_api_to_pypredef.py >>> (this file should also be in your local PyDev) >>> >>> Cheers, >>> >>> Fabio >>> >>> On Thu, Apr 28, 2011 at 9:36 AM, Álvaro J. Iradier <air...@gm...> wrote: >>>> Hi all, >>>> >>>> I'm trying to make a Jython Script for Pydev for better integration >>>> with web2py development. >>>> >>>> Basically, I need some way to access the python interpreter that is >>>> used for syntax check and code completion from the jython script. >>>> >>>> What I would like to do is, when a .py file for a web2py project is >>>> loaded in the editor, fist, make some imports into the current >>>> interpreter, for example: >>>> >>>> from gluon.globals import Request >>>> from gluon.globals import Session >>>> from gluon.globals import Response >>>> >>>> then instantiate some of this classes into global variables: >>>> >>>> request=Request() >>>> session=Session() >>>> response=Response() >>>> >>>> to simulate a real request environment. >>>> >>>> Finally, I want to "exec" all the files in the models/ folder, in >>>> order to have the globals declared in there into de interpreter. >>>> >>>> Can you guide me into the right path? I'm totally lost looking at the >>>> code in com.python.pydev.codecompletion... I don't know how to get >>>> there from the jython script (or even if it's possible). >>>> >>>> Thanks very much. >>>> >>>> -- >>>> >>>> (:=================================:) >>>> Alvaro J. Iradier Muro - air...@gm... >>>> >>>> ------------------------------------------------------------------------------ >>>> WhatsUp Gold - Download Free Network Management Software >>>> The most intuitive, comprehensive, and cost-effective network >>>> management toolset available today. Delivers lowest initial >>>> acquisition cost and overall TCO of any competing solution. >>>> http://p.sf.net/sfu/whatsupgold-sd >>>> _______________________________________________ >>>> pydev-code mailing list >>>> pyd...@li... >>>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>>> >>> >>> ------------------------------------------------------------------------------ >>> WhatsUp Gold - Download Free Network Management Software >>> The most intuitive, comprehensive, and cost-effective network >>> management toolset available today. Delivers lowest initial >>> acquisition cost and overall TCO of any competing solution. >>> http://p.sf.net/sfu/whatsupgold-sd >>> _______________________________________________ >>> pydev-code mailing list >>> pyd...@li... >>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>> >> >> >> >> -- >> (:=================================:) >> Alvaro J. Iradier Muro - air...@gm... >> >> ------------------------------------------------------------------------------ >> WhatsUp Gold - Download Free Network Management Software >> The most intuitive, comprehensive, and cost-effective network >> management toolset available today. Delivers lowest initial >> acquisition cost and overall TCO of any competing solution. >> http://p.sf.net/sfu/whatsupgold-sd >> _______________________________________________ >> pydev-code mailing list >> pyd...@li... >> https://lists.sourceforge.net/lists/listinfo/pydev-code >> > > ------------------------------------------------------------------------------ > WhatsUp Gold - Download Free Network Management Software > The most intuitive, comprehensive, and cost-effective network > management toolset available today. Delivers lowest initial > acquisition cost and overall TCO of any competing solution. > http://p.sf.net/sfu/whatsupgold-sd > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > -- (:=================================:) Alvaro J. Iradier Muro - air...@gm... |
From: Fabio Z. <fa...@gm...> - 2011-04-28 14:08:03
|
I believe you installed things with easy-install, right? It seems that the easy-install.pth adds those for you regardless of what PyDev will pass as the PYTHONPATH (that's something PyDev can't control). A better way for you might be using virtualenv (http://pypi.python.org/pypi/virtualenv), where each interpreter may be configured just with the dependencies you want (and then you can add each of those interpreters as a different interpreter in PyDev -- i.e.: http://pydev.blogspot.com/2010/04/pydev-and-virtualenv.html). Cheers, Fabio On Wed, Apr 27, 2011 at 5:32 PM, j brandon keith <jbr...@gm...> wrote: > Hi, I'm wondering if this is a bug...I've been using pydev for many years > and have consistently had problems with the python path...for example, I > have a script I'm running which pydev says is run with the following > pythonpath: > /home/jbk/helios/eclipse/plugins/org.python.pydev_1.6.5.2011020317/PySrc/pydev_sitecustomize:/home/jbk/workspace/parnasis/src:/usr/lib/pymodules/python2.6:/usr/lib/pymodules/python2.6/gtk-2.0:/usr/lib/python2.6:/usr/lib/python2.6/dist-packages:/usr/lib/python2.6/dist-packages/PIL:/usr/lib/python2.6/dist-packages/gst-0.10:/usr/lib/python2.6/dist-packages/gtk-2.0:/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode:/usr/lib/python2.6/lib-dynload:/usr/lib/python2.6/lib-old:/usr/lib/python2.6/lib-tk:/usr/lib/python2.6/plat-linux2:/usr/local/lib/python2.6/dist-packages:/usr/local/lib/python2.6/dist-packages/PyCifRW-3.1.4p01-py2.6-linux-x86_64.egg:/usr/local/lib/python2.6/dist-packages/matter-0.8_r983_20110415-py2.6.egg > Note I've wired the project with a source > directory /home/jbk/workspace/parnasis/src. However, at the top of the > script i import sys and print sys.path: > ['/home/jbk/workspace/parnasis/useCases/mdDos/ysz/ysz12', > '/usr/local/lib/python2.6/dist-packages/dj > ango_evolution-0.6.3alpha0-py2.6.egg', > '/usr/local/lib/python2.6/dist-packages/Sphinx-1.0.7-py2.6.eg > g', '/usr/local/lib/python2.6/dist-packages/Jinja2-2.5.5-py2.6.egg', > '/usr/local/lib/python2.6/dist- > packages/matter-0.8_20110426-py2.6.egg', > '/usr/local/lib/python2.6/dist-packages/parnasis-0.5-py2.6. > egg', '/usr/local/lib/python2.6/dist-packages/plotlib-0.3-py2.6.egg', > '/home/jbk/workspace/parnasis/ > src', '/usr/lib/pymodules/python2.6', > '/usr/lib/pymodules/python2.6/gtk-2.0', '/usr/lib/python2.6', > '/usr/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages/PIL', > '/usr/lib/python2.6/dist > -packages/gst-0.10', '/usr/lib/python2.6/dist-packages/gtk-2.0', > '/usr/lib/python2.6/dist-packages/w > x-2.8-gtk2-unicode', '/usr/lib/python2.6/lib-dynload', > '/usr/lib/python2.6/lib-old', '/usr/lib/pytho > n2.6/lib-tk', '/usr/lib/python2.6/plat-linux2', > '/usr/local/lib/python2.6/dist-packages', '/usr/loca > l/lib/python2.6/dist-packages/PyCifRW-3.1.4p01-py2.6-linux-x86_64.egg', > '/usr/local/lib/python2.6/di > st-packages/matter-0.8_r983_20110415-py2.6.egg'] > Why are they different? In this one, we see the first entry is the > directory where the script is located, which is logical....next I would > expect to see the rest of the entries above..unfortunately I see a lot of > eggs, some of which conflict with my source > directory '/home/jbk/workspace/parnasis/src' which i think should be the > second or third entry...any explanations? > brandon > > > ------------------------------------------------------------------------------ > WhatsUp Gold - Download Free Network Management Software > The most intuitive, comprehensive, and cost-effective network > management toolset available today. Delivers lowest initial > acquisition cost and overall TCO of any competing solution. > http://p.sf.net/sfu/whatsupgold-sd > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > > |
From: Fabio Z. <fa...@es...> - 2011-04-28 14:06:30
|
On Thu, Apr 28, 2011 at 10:18 AM, Álvaro J. Iradier <air...@gm...> wrote: > That might work for predefined classes or items, like "request", > "response", "session"..., but I want to go further. I want to > dinamically parse the files in models/, which define some variables > and functions, and I want to make those available too. > > Is it possible to get this far using the jython scripting, or should I > develop a plugin or a patch for pydev? > Can you give an actual example with code on what you want to achieve? Cheers, Fabio > Greets. > > On Thu, Apr 28, 2011 at 3:07 PM, Fabio Zadrozny <fab...@gm...> wrote: >> Might be easier providing predefined completions (i.e.: generating >> python stub code for web2py -- you can create a Python script that >> loads the environment and extracts info as needed). >> >> See: http://pydev.org/manual_101_interpreter.html#id2 for details >> >> An example script that converts QScintilla .api files to the >> predefined completions is available at: >> https://github.com/aptana/Pydev/blob/master/plugins/org.python.pydev.jython/jysrc/convert_api_to_pypredef.py >> (this file should also be in your local PyDev) >> >> Cheers, >> >> Fabio >> >> On Thu, Apr 28, 2011 at 9:36 AM, Álvaro J. Iradier <air...@gm...> wrote: >>> Hi all, >>> >>> I'm trying to make a Jython Script for Pydev for better integration >>> with web2py development. >>> >>> Basically, I need some way to access the python interpreter that is >>> used for syntax check and code completion from the jython script. >>> >>> What I would like to do is, when a .py file for a web2py project is >>> loaded in the editor, fist, make some imports into the current >>> interpreter, for example: >>> >>> from gluon.globals import Request >>> from gluon.globals import Session >>> from gluon.globals import Response >>> >>> then instantiate some of this classes into global variables: >>> >>> request=Request() >>> session=Session() >>> response=Response() >>> >>> to simulate a real request environment. >>> >>> Finally, I want to "exec" all the files in the models/ folder, in >>> order to have the globals declared in there into de interpreter. >>> >>> Can you guide me into the right path? I'm totally lost looking at the >>> code in com.python.pydev.codecompletion... I don't know how to get >>> there from the jython script (or even if it's possible). >>> >>> Thanks very much. >>> >>> -- >>> >>> (:=================================:) >>> Alvaro J. Iradier Muro - air...@gm... >>> >>> ------------------------------------------------------------------------------ >>> WhatsUp Gold - Download Free Network Management Software >>> The most intuitive, comprehensive, and cost-effective network >>> management toolset available today. Delivers lowest initial >>> acquisition cost and overall TCO of any competing solution. >>> http://p.sf.net/sfu/whatsupgold-sd >>> _______________________________________________ >>> pydev-code mailing list >>> pyd...@li... >>> https://lists.sourceforge.net/lists/listinfo/pydev-code >>> >> >> ------------------------------------------------------------------------------ >> WhatsUp Gold - Download Free Network Management Software >> The most intuitive, comprehensive, and cost-effective network >> management toolset available today. Delivers lowest initial >> acquisition cost and overall TCO of any competing solution. >> http://p.sf.net/sfu/whatsupgold-sd >> _______________________________________________ >> pydev-code mailing list >> pyd...@li... >> https://lists.sourceforge.net/lists/listinfo/pydev-code >> > > > > -- > (:=================================:) > Alvaro J. Iradier Muro - air...@gm... > > ------------------------------------------------------------------------------ > WhatsUp Gold - Download Free Network Management Software > The most intuitive, comprehensive, and cost-effective network > management toolset available today. Delivers lowest initial > acquisition cost and overall TCO of any competing solution. > http://p.sf.net/sfu/whatsupgold-sd > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > |
From: Álvaro J. I. <air...@gm...> - 2011-04-28 13:19:11
|
That might work for predefined classes or items, like "request", "response", "session"..., but I want to go further. I want to dinamically parse the files in models/, which define some variables and functions, and I want to make those available too. Is it possible to get this far using the jython scripting, or should I develop a plugin or a patch for pydev? Greets. On Thu, Apr 28, 2011 at 3:07 PM, Fabio Zadrozny <fab...@gm...> wrote: > Might be easier providing predefined completions (i.e.: generating > python stub code for web2py -- you can create a Python script that > loads the environment and extracts info as needed). > > See: http://pydev.org/manual_101_interpreter.html#id2 for details > > An example script that converts QScintilla .api files to the > predefined completions is available at: > https://github.com/aptana/Pydev/blob/master/plugins/org.python.pydev.jython/jysrc/convert_api_to_pypredef.py > (this file should also be in your local PyDev) > > Cheers, > > Fabio > > On Thu, Apr 28, 2011 at 9:36 AM, Álvaro J. Iradier <air...@gm...> wrote: >> Hi all, >> >> I'm trying to make a Jython Script for Pydev for better integration >> with web2py development. >> >> Basically, I need some way to access the python interpreter that is >> used for syntax check and code completion from the jython script. >> >> What I would like to do is, when a .py file for a web2py project is >> loaded in the editor, fist, make some imports into the current >> interpreter, for example: >> >> from gluon.globals import Request >> from gluon.globals import Session >> from gluon.globals import Response >> >> then instantiate some of this classes into global variables: >> >> request=Request() >> session=Session() >> response=Response() >> >> to simulate a real request environment. >> >> Finally, I want to "exec" all the files in the models/ folder, in >> order to have the globals declared in there into de interpreter. >> >> Can you guide me into the right path? I'm totally lost looking at the >> code in com.python.pydev.codecompletion... I don't know how to get >> there from the jython script (or even if it's possible). >> >> Thanks very much. >> >> -- >> >> (:=================================:) >> Alvaro J. Iradier Muro - air...@gm... >> >> ------------------------------------------------------------------------------ >> WhatsUp Gold - Download Free Network Management Software >> The most intuitive, comprehensive, and cost-effective network >> management toolset available today. Delivers lowest initial >> acquisition cost and overall TCO of any competing solution. >> http://p.sf.net/sfu/whatsupgold-sd >> _______________________________________________ >> pydev-code mailing list >> pyd...@li... >> https://lists.sourceforge.net/lists/listinfo/pydev-code >> > > ------------------------------------------------------------------------------ > WhatsUp Gold - Download Free Network Management Software > The most intuitive, comprehensive, and cost-effective network > management toolset available today. Delivers lowest initial > acquisition cost and overall TCO of any competing solution. > http://p.sf.net/sfu/whatsupgold-sd > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > -- (:=================================:) Alvaro J. Iradier Muro - air...@gm... |
From: Fabio Z. <fab...@gm...> - 2011-04-28 13:08:24
|
Might be easier providing predefined completions (i.e.: generating python stub code for web2py -- you can create a Python script that loads the environment and extracts info as needed). See: http://pydev.org/manual_101_interpreter.html#id2 for details An example script that converts QScintilla .api files to the predefined completions is available at: https://github.com/aptana/Pydev/blob/master/plugins/org.python.pydev.jython/jysrc/convert_api_to_pypredef.py (this file should also be in your local PyDev) Cheers, Fabio On Thu, Apr 28, 2011 at 9:36 AM, Álvaro J. Iradier <air...@gm...> wrote: > Hi all, > > I'm trying to make a Jython Script for Pydev for better integration > with web2py development. > > Basically, I need some way to access the python interpreter that is > used for syntax check and code completion from the jython script. > > What I would like to do is, when a .py file for a web2py project is > loaded in the editor, fist, make some imports into the current > interpreter, for example: > > from gluon.globals import Request > from gluon.globals import Session > from gluon.globals import Response > > then instantiate some of this classes into global variables: > > request=Request() > session=Session() > response=Response() > > to simulate a real request environment. > > Finally, I want to "exec" all the files in the models/ folder, in > order to have the globals declared in there into de interpreter. > > Can you guide me into the right path? I'm totally lost looking at the > code in com.python.pydev.codecompletion... I don't know how to get > there from the jython script (or even if it's possible). > > Thanks very much. > > -- > > (:=================================:) > Alvaro J. Iradier Muro - air...@gm... > > ------------------------------------------------------------------------------ > WhatsUp Gold - Download Free Network Management Software > The most intuitive, comprehensive, and cost-effective network > management toolset available today. Delivers lowest initial > acquisition cost and overall TCO of any competing solution. > http://p.sf.net/sfu/whatsupgold-sd > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > |
From: Álvaro J. I. <air...@gm...> - 2011-04-28 12:36:48
|
Hi all, I'm trying to make a Jython Script for Pydev for better integration with web2py development. Basically, I need some way to access the python interpreter that is used for syntax check and code completion from the jython script. What I would like to do is, when a .py file for a web2py project is loaded in the editor, fist, make some imports into the current interpreter, for example: from gluon.globals import Request from gluon.globals import Session from gluon.globals import Response then instantiate some of this classes into global variables: request=Request() session=Session() response=Response() to simulate a real request environment. Finally, I want to "exec" all the files in the models/ folder, in order to have the globals declared in there into de interpreter. Can you guide me into the right path? I'm totally lost looking at the code in com.python.pydev.codecompletion... I don't know how to get there from the jython script (or even if it's possible). Thanks very much. -- (:=================================:) Alvaro J. Iradier Muro - air...@gm... |
From: j b. k. <jbr...@gm...> - 2011-04-27 20:33:05
|
Hi, I'm wondering if this is a bug...I've been using pydev for many years and have consistently had problems with the python path...for example, I have a script I'm running which pydev says is run with the following pythonpath: /home/jbk/helios/eclipse/plugins/org.python.pydev_1.6.5.2011020317/PySrc/pydev_sitecustomize:/home/jbk/workspace/parnasis/src:/usr/lib/pymodules/python2.6:/usr/lib/pymodules/python2.6/gtk-2.0:/usr/lib/python2.6:/usr/lib/python2.6/dist-packages:/usr/lib/python2.6/dist-packages/PIL:/usr/lib/python2.6/dist-packages/gst-0.10:/usr/lib/python2.6/dist-packages/gtk-2.0:/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode:/usr/lib/python2.6/lib-dynload:/usr/lib/python2.6/lib-old:/usr/lib/python2.6/lib-tk:/usr/lib/python2.6/plat-linux2:/usr/local/lib/python2.6/dist-packages:/usr/local/lib/python2.6/dist-packages/PyCifRW-3.1.4p01-py2.6-linux-x86_64.egg:/usr/local/lib/python2.6/dist-packages/matter-0.8_r983_20110415-py2.6.egg Note I've wired the project with a source directory /home/jbk/workspace/parnasis/src. However, at the top of the script i import sys and print sys.path: ['/home/jbk/workspace/parnasis/useCases/mdDos/ysz/ysz12', '/usr/local/lib/python2.6/dist-packages/dj ango_evolution-0.6.3alpha0-py2.6.egg', '/usr/local/lib/python2.6/dist-packages/Sphinx-1.0.7-py2.6.eg g', '/usr/local/lib/python2.6/dist-packages/Jinja2-2.5.5-py2.6.egg', '/usr/local/lib/python2.6/dist- packages/matter-0.8_20110426-py2.6.egg', '/usr/local/lib/python2.6/dist-packages/parnasis-0.5-py2.6. egg', '/usr/local/lib/python2.6/dist-packages/plotlib-0.3-py2.6.egg', '/home/jbk/workspace/parnasis/ src', '/usr/lib/pymodules/python2.6', '/usr/lib/pymodules/python2.6/gtk-2.0', '/usr/lib/python2.6', '/usr/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages/PIL', '/usr/lib/python2.6/dist -packages/gst-0.10', '/usr/lib/python2.6/dist-packages/gtk-2.0', '/usr/lib/python2.6/dist-packages/w x-2.8-gtk2-unicode', '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/lib-old', '/usr/lib/pytho n2.6/lib-tk', '/usr/lib/python2.6/plat-linux2', '/usr/local/lib/python2.6/dist-packages', '/usr/loca l/lib/python2.6/dist-packages/PyCifRW-3.1.4p01-py2.6-linux-x86_64.egg', '/usr/local/lib/python2.6/di st-packages/matter-0.8_r983_20110415-py2.6.egg'] Why are they different? In this one, we see the first entry is the directory where the script is located, which is logical....next I would expect to see the rest of the entries above..unfortunately I see a lot of eggs, some of which conflict with my source directory '/home/jbk/workspace/parnasis/src' which i think should be the second or third entry...any explanations? brandon |
From: Jonah G. <jo...@ki...> - 2011-04-20 20:01:46
|
Hi PyDev Coders, I have implemented a feature that I plan to roll out to our local PyDev users here, and am soliciting feedback on it before I make a Pull Request (Is that the right thing to do, or should I just make the pull request?). I have added command completion for files and folders in the interactive console. The features are: - files (with a file icon) and folders (with a folder icon) are in the completion list - if a slash is part of the text that activates the completion, only files and folders are listed - a slash is a new optional activation character (off by default) - absolute and relative path names are supported from normal interactive console. - absolute paths are supported from debug interactive console The attached pdf has a few screen shots. The changes is available here: https://github.com/jonahkichwacoders/Pydev/commit/88a35936c26b7c15972857c53945d06d25681212 Please let me know if this is suitable for a pull request, or how I can change it to make it suitable. Thank you, Jonah |
From: Fabio Z. <fa...@gm...> - 2011-04-04 15:40:15
|
Hi All, PyDev 2.0 has been released Details on PyDev: http://pydev.org Details on its development: http://pydev.blogspot.com Release Highlights: ======================= Major --------- * TDD actions on Ctrl+1 * Improved code coverage support See video at: http://pydev.org/video_pydev_20.html with these improvements Noteworthy ---------------- PyUnit * It's possible to pin a test run and restore it later. * Errors that occur while importing modules are properly shown. * It's possible to override the test runner configurations for a given launch. * The Nose test runner works properly when there's an error in a fixture. Editor * When there's some text selected and ' or " is entered, the content is converted to a string. * Handling literals with ui linking. * Creating ui link in the editor after entering (,[,{ when it is auto-closed. * On hover, when there's a name defined in another module, the statement containing the name is shown. * It's possible to launch an editor with a file not in the workspace (a project must be selected in this case) * If a line starts with __version__ no import is added above it. * When doing assign to attributes, if there's a pass in the line the assign will be added, it's removed. * When Ctrl+1 is used to add an import on an unresolved variable, if Ctrl is pressed on apply a local import is done. Interactive console (options) * Focus on creation * When created the selection may be directly sent to the console The DJANGO_SETTINGS_MODULE environment var is passed when making a launch. The outline page now has a filter. The input() method properly works in Python 3.2 (last "\r" no longer shown). **LOTS** of other adjustments and bug fixes What is PyDev? --------------------------- PyDev is a plugin that enables users to use Eclipse for Python, Jython and IronPython development -- making Eclipse a first class Python IDE -- It comes with many goodies such as code completion, syntax highlighting, syntax analysis, refactor, debug and many others. Cheers, -- Fabio Zadrozny ------------------------------------------------------ Software Developer Appcelerator http://appcelerator.com/ Aptana http://aptana.com/ PyDev - Python Development Environment for Eclipse http://pydev.org http://pydev.blogspot.com |
From: Jonah G. <jo...@ki...> - 2011-03-21 14:37:53
|
Hi Fabio, Thank you for the feedback. I have had a look at the code you mentioned and I think it is not the best first project. I have some enhancements for the command completion within the interactive console that I will complete first. That should make me more familiar with the code so I can better implement the asynchronous features. BTW The features I am looking into adding are: * a preference to hide completions that start with _, unless the underscore is typed. This is so that private members are hidden by default. * add completions of file system path names so that commands like open(...) are easier to type. Thank you, Jonah On 20 March 2011 11:43, Fabio Zadrozny <fa...@gm...> wrote: > Hi Jonah, > > The problem lies in the actual design, which does not account for > that. There are a number of things to be changed. Probably you want to > start looking at > > org.python.pydev.dltk.console.ui.internal.ScriptConsoleDocumentListener.execCommand, > which will create a local callback for onResponseReceived (this is the > place that'll start a command and make it be execute in the python > backend). > > Also, in the python backend you'll probably also want to change > pydevconsole.InterpreterInterface.addExec which does the actual exec > to create a Thread to gather the output while things are happening > (note that the command itself must be executed on the main Thread). > > If you have more doubts, just ask (I'm not sure if you'll have issues > in the document synchronization for input/output in this case as the > command will be running, so, you should not accept another input while > the current doesn't end). > > Cheers, > > Fabio > > On Sat, Mar 19, 2011 at 10:44 AM, Jonah Graham <jo...@ki...> wrote: >> Hello, >> >> I am using PyDev and I would like to implement an improvement to the >> PyDev console related to the asynchonous behaviour. >> >> In particular I want to remove this limitation (from >> http://pydev.org/manual_adv_interactive_console.html) >> >> Limitation: Output is not asynchonous (stdout and stderr are only >> shown after a new command is sent to the console) >> >> A simplified example of what I want to work is: >> for i in range(10): print 'You can see this as it runs', i; time.sleep(0.5) >> >> I had a look through the bug lists and email lists and other than a >> couple of places re-stating that this is a limitation, I couldn't find >> record of why it was a limitation, or what could be done about it. >> >> Before I get too buried in this code, I thought I would ask what the >> issues are. Please feel free to point me at a bug if I have missed it. >> >> Thank you, >> Jonah >> >> ------------------------------------------------------------------------------ >> Colocation vs. Managed Hosting >> A question and answer guide to determining the best fit >> for your organization - today and in the future. >> http://p.sf.net/sfu/internap-sfd2d >> _______________________________________________ >> pydev-code mailing list >> pyd...@li... >> https://lists.sourceforge.net/lists/listinfo/pydev-code >> > |
From: Fabio Z. <fa...@gm...> - 2011-03-20 11:44:16
|
Hi Jonah, The problem lies in the actual design, which does not account for that. There are a number of things to be changed. Probably you want to start looking at org.python.pydev.dltk.console.ui.internal.ScriptConsoleDocumentListener.execCommand, which will create a local callback for onResponseReceived (this is the place that'll start a command and make it be execute in the python backend). Also, in the python backend you'll probably also want to change pydevconsole.InterpreterInterface.addExec which does the actual exec to create a Thread to gather the output while things are happening (note that the command itself must be executed on the main Thread). If you have more doubts, just ask (I'm not sure if you'll have issues in the document synchronization for input/output in this case as the command will be running, so, you should not accept another input while the current doesn't end). Cheers, Fabio On Sat, Mar 19, 2011 at 10:44 AM, Jonah Graham <jo...@ki...> wrote: > Hello, > > I am using PyDev and I would like to implement an improvement to the > PyDev console related to the asynchonous behaviour. > > In particular I want to remove this limitation (from > http://pydev.org/manual_adv_interactive_console.html) > > Limitation: Output is not asynchonous (stdout and stderr are only > shown after a new command is sent to the console) > > A simplified example of what I want to work is: > for i in range(10): print 'You can see this as it runs', i; time.sleep(0.5) > > I had a look through the bug lists and email lists and other than a > couple of places re-stating that this is a limitation, I couldn't find > record of why it was a limitation, or what could be done about it. > > Before I get too buried in this code, I thought I would ask what the > issues are. Please feel free to point me at a bug if I have missed it. > > Thank you, > Jonah > > ------------------------------------------------------------------------------ > Colocation vs. Managed Hosting > A question and answer guide to determining the best fit > for your organization - today and in the future. > http://p.sf.net/sfu/internap-sfd2d > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > |
From: Jonah G. <jo...@ki...> - 2011-03-19 14:01:12
|
Hello, I am using PyDev and I would like to implement an improvement to the PyDev console related to the asynchonous behaviour. In particular I want to remove this limitation (from http://pydev.org/manual_adv_interactive_console.html) Limitation: Output is not asynchonous (stdout and stderr are only shown after a new command is sent to the console) A simplified example of what I want to work is: for i in range(10): print 'You can see this as it runs', i; time.sleep(0.5) I had a look through the bug lists and email lists and other than a couple of places re-stating that this is a limitation, I couldn't find record of why it was a limitation, or what could be done about it. Before I get too buried in this code, I thought I would ask what the issues are. Please feel free to point me at a bug if I have missed it. Thank you, Jonah |
From: Fabio Z. <fa...@gm...> - 2011-02-22 15:41:36
|
Actually, pydev does not have any difference from 32 to 64 bits (it only generates the .jars which are platform-independent), so, just build the 32 bit variables and it should work anywhere (with a 64 or 32 bit vm and on any OS). Cheers, Fabio On Tue, Feb 22, 2011 at 11:23 AM, Hussain Bohra <hus...@ya...> wrote: > Hi All, > > I am building pydev code locally. > > To build 32 bit pydev, I set the following variables before executing ant > build script: > > set BASEOS=win32 > set BASEWS=win32 > set BASEARCH=x86 > > Whereas to build 64 bit pydev, I set the following variables before > executing ant build script: > > set BASEOS=win64 > set BASEWS=win64 > set BASEARCH=x64 > > Follwing are the other necessary details: > > Java - 32 bit. > Operating System - Windows 7 Ultimate, 64 bit. > > Could you please let me know whether the above mentioned steps are correct. > > > > Also, after my build is successful, how can I verify whether I have 32 bit > pydev or 64 bit pydev ? > > > > Thanks in Advance. > > > > Thanks and Regards, > Hussain Bohra > Tavant Technologies, > Bangalore-95 > mail-to:hus...@ta... > mobile : +91 99867 95727 > > |
From: Hussain B. <hus...@ya...> - 2011-02-22 14:23:44
|
Hi All, I am building pydev code locally. To build 32 bit pydev, I set the following variables before executing ant build script: * set BASEOS=win32 * set BASEWS=win32 * set BASEARCH=x86 Whereas to build 64 bit pydev, I set the following variables before executing ant build script: * set BASEOS=win64 * set BASEWS=win64 * set BASEARCH=x64 Follwing are the other necessary details: * Java - 32 bit. * Operating System - Windows 7 Ultimate, 64 bit. Could you please let me know whether the above mentioned steps are correct. Also, after my build is successful, how can I verify whether I have 32 bit pydev or 64 bit pydev ? Thanks in Advance. Thanks and Regards, Hussain Bohra Tavant Technologies, Bangalore-95 mail-to:hus...@ta... mobile : +91 99867 95727 |
From: Doubleday, D. <ddo...@vo...> - 2011-02-17 15:40:32
|
I don't know if this will help, but this is what we do to create a new interpreter programmatically. Prior to this call, we have gotten the list of InterpreterInfo from Pydev, added a new InterpreterInfo object for our new interpreter to the list, and then called this method. private static void setInterpreters(List<IInterpreterInfo> validInterpreters, IProgressMonitor monitor) { // 1. stop any running interpreters List<IInterpreterInfo> interpreterList = getInstalledInterpreters(); // Restoring the interpreters and stopping the server shell for (IInterpreterInfo interpreter : interpreterList) { AbstractShell.stopServerShell( interpreter, AbstractShell.COMPLETION_SHELL); } // 2. set new interpreter info PydevPlugin.getPythonInterpreterManager(true).setInfos( validInterpreters); // 3. configure new interpreters PydevPlugin.getPythonInterpreterManager(true) .restorePythopathForInterpreters(monitor, null); // 4. persist interpreter info PydevPlugin.getPythonInterpreterManager(true) .saveInterpretersInfoModulesManager(); // 5. get persist string and set it back to manager String persistInfo = PydevPlugin.getPythonInterpreterManager(true) .getStringToPersist( validInterpreters .toArray(new IInterpreterInfo[validInterpreters.size()])); PydevPlugin.getPythonInterpreterManager(true).setPersistedString( persistInfo); // 6. Reloading the Interpreter page for python PreferenceManager pm = PlatformUI.getWorkbench().getPreferenceManager(); IPreferenceNode node = pm .find("org.python.pydev.prefs/" //$NON-NLS-1$ + "org.python.pydev.ui.pythonpathconf.interpreterPreferencesPagePython"); //$NON-NLS-1$ WorkbenchPreferenceNode wpNode = (WorkbenchPreferenceNode) node; wpNode.setPage(null); } -----Original Message----- From: Thomas Johnsson [mailto:th...@sk...] Sent: Thursday, February 17, 2011 5:09 AM To: pyd...@li... Subject: [Pydev-code] Programmatically set python interpreter and createproject Hi, I'm trying to programmatically, in a new workspace, - set python interpreter whose details are known, - create a pydev project, using the interpreter. I've tried things along the lines of String interpreterpersistedstring = "Name:dwspython:EndName:Version2.6......&&&&&"; // as previously obtained from a getPersistedString IInterpreterManager im = PydevPlugin.getPythonInterpreterManager(); im.setPersistedString(interpreterpersistedstring); and then create the project using PyStructureConfigHelpers.createPydevProject(projectname, projectLocationPath, null, // IProject[] references monitor, IPythonNature.PYTHON_VERSION_2_6, "dwspython", null, null, null); The immediate problem with this is that the interpreter set with setPersistedString is not known by createPydevProject also confirmed by im.hasInfoOnInterpreter("dwspython") returning false. A call im.saveInterpretersInfoModulesManager(); does not help either it seems. Any help and hints on how to do this properly is greatly appreciated! Thanks, -- Thomas Johnsson ------------------------------------------------------------------------ ------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ pydev-code mailing list pyd...@li... https://lists.sourceforge.net/lists/listinfo/pydev-code |
From: Thomas J. <th...@sk...> - 2011-02-17 10:24:32
|
Hi, I'm trying to programmatically, in a new workspace, - set python interpreter whose details are known, - create a pydev project, using the interpreter. I've tried things along the lines of String interpreterpersistedstring = "Name:dwspython:EndName:Version2.6......&&&&&"; // as previously obtained from a getPersistedString IInterpreterManager im = PydevPlugin.getPythonInterpreterManager(); im.setPersistedString(interpreterpersistedstring); and then create the project using PyStructureConfigHelpers.createPydevProject(projectname, projectLocationPath, null, // IProject[] references monitor, IPythonNature.PYTHON_VERSION_2_6, "dwspython", null, null, null); The immediate problem with this is that the interpreter set with setPersistedString is not known by createPydevProject also confirmed by im.hasInfoOnInterpreter("dwspython") returning false. A call im.saveInterpretersInfoModulesManager(); does not help either it seems. Any help and hints on how to do this properly is greatly appreciated! Thanks, -- Thomas Johnsson |
From: Fabio Z. <fa...@es...> - 2011-02-09 19:18:09
|
Well, I can point you in the direction, but I think we should go step by step, so, which of the conditional breakpoints feature that JDT has you'd like to add first? Cheers, Fabio On Wed, Feb 9, 2011 at 3:49 PM, Marcelo Sena <mar...@gm...> wrote: > So I created a fork of the source code to work on that. My plan is to > check both how pydev does it and how JDT implements it. And finally > make they work the same. Its very vague and I am not familiar with > plugin development. But I know how to program in java, python and use > some of its toolset. Any thoughts about my plan/idea? > > -- > "<Cheesy_Signature>" > Marcelo Sena > > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > |