Menu

#82 Handling files with 'python' content type

open
nobody
None
5
2006-02-23
2006-02-22
No

Hi,

Is it possible to have PyDev treat files that don't
have a .py extension as python code ? Would be very
handy for working on Zope scripts stored on the
filesystem which usually don't have an extension.

Cheers, Andrew.

Discussion

  • Fabio Zadrozny

    Fabio Zadrozny - 2006-02-22
    • status: open --> closed
     
  • Fabio Zadrozny

    Fabio Zadrozny - 2006-02-22

    Logged In: YES
    user_id=617340

    Hi,

    YOu can already do that... You can associate those
    extensions in window > preferences > general > editors >
    file associations.

    Cheers,

    Fabio

     
  • Andrew Groom

    Andrew Groom - 2006-02-22

    Logged In: YES
    user_id=91016

    Thanks, Fabio, but I should have been clearer - these are
    files with *no* extension, e.g., a Zope python script object
    called "get_some_stuff" equating to a file of the same name.

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2006-02-23

    Logged In: YES
    user_id=617340

    Ok, I see what you're saying... I just don't know how to do
    it either (that's more an eclipse than a Pydev thing)

    Couldn't you get some extension there? (any extension would
    do)... Otherwise, you can try to make a feature request for
    the Eclipse guys at Eclipse.org, because currently, I
    believe you cannot make a '*' association (which -- I think
    -- is what you'd like).

    Or maybe they know something I don't here...

    Cheers,

    Fabio

     
  • Andrew Groom

    Andrew Groom - 2006-02-23

    Logged In: YES
    user_id=91016

    Thanks, Fabio. I agree - it's an eclipse issue, really. It
    would be nice if you could attach a content type property to
    the file somehow and have Eclipse use that to determine the
    editor, instead of just inferring it from the extension.

    I'll put in a feature request for it, as you suggest. PyDev
    is very cool, btw :-)

    Cheers, Andrew.

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2006-02-23
    • summary: Handling files without .py extension --> Handling files with 'python' content type
    • status: closed --> open
     
  • Fabio Zadrozny

    Fabio Zadrozny - 2006-02-23

    Logged In: YES
    user_id=617340

    Hi Andrew,

    Yeah, maybe a content type property could do it (just have
    to research how to do that...)

    I'm reopening the bug to see how (if) it can be done through
    its 'content type'

    Cheers,

    Fabio

     
  • Nobody/Anonymous

    Logged In: NO

    I have a some problem, use python for cgi scripting
    and pydev dont support code completion for other files as *.py.

    With eclipse can man select editor "window > preferences >
    general > editors > file associations." for file expansion
    and get so syntax color,

    but code completion is a pydev kind, i hope its exist any
    answer for this problem.

    S.o.S
    Sergei

     
  • Rion

    Rion - 2011-05-24

    It's also impossbile to choose script w/o py extension in "Run Configurations".
    its very annoying since I have to make simlinks for each script add them to vcs ignore.

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2011-05-24

    For files that have an extension, you must associate the extensions in PyDev > Editor > Code Style > File Types.

    and also in window > preferences > general > editors > file associations

    If the file doesn't have an extension, you have to right click it and open as PyDev and later you can run it pressing 'F9' (or Ctrl+F9 for unit-tests) -- with focus on the opened editor.

     
  • Rion

    Rion - 2011-05-24

    In most cases I need to pass arguments as well

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2011-05-24

    After doing the run, you can go to run > run configurations, select the run configuration that was created for the F9 and edit it as you want.

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.