how to get the os file icon for a given content-type?

Discussion in 'Python' started by neoedmund, Aug 28, 2006.

  1. neoedmund

    neoedmund Guest

    any simple method?
     
    neoedmund, Aug 28, 2006
    #1
    1. Advertising

  2. neoedmund wrote:
    <ot>Please repeat the whole question in the message body</ot>

    =>how to get the os file icon for a given content-type?
    > any simple method?


    This is specific to your OS (and FWIW, there's nothing like a "file
    icon" on the OS I'm using).


    --
    bruno desthuilliers
    python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
    p in ''.split('@')])"
     
    Bruno Desthuilliers, Aug 28, 2006
    #2
    1. Advertising

  3. neoedmund

    neoedmund Guest

    So what? Java 5.0 has the method, why python has not?
    Bruno Desthuilliers wrote:
    > neoedmund wrote:
    > <ot>Please repeat the whole question in the message body</ot>
    >
    > =>how to get the os file icon for a given content-type?
    > > any simple method?

    >
    > This is specific to your OS (and FWIW, there's nothing like a "file
    > icon" on the OS I'm using).
    >
    >
    > --
    > bruno desthuilliers
    > python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
    > p in ''.split('@')])"
     
    neoedmund, Aug 28, 2006
    #3
  4. "neoedmund" <> wrote:

    > So what? Java 5.0 has the method, why python has not?


    python's developed by volunteers, and nobody has volunteered to develop
    such a function.

    why not check how Java does this, and contribute the code ?

    </F>
     
    Fredrik Lundh, Aug 28, 2006
    #4
  5. neoedmund

    Paul Boddie Guest

    neoedmund wrote:

    [File icons for a given content type]

    > So what? Java 5.0 has the method, why python has not?


    I'd be generally surprised if whichever Java API responsible for this
    managed to work it out correctly for the different free desktop
    environments (KDE, GNOME, etc.), partly because things like icon naming
    and organisation have only been standardised relatively recently, and
    partly because the heritage of Java's cross-platform capabilities would
    suggest some suboptimal solution involving icons that are totally alien
    to the actual desktop environment in use (or at best some icons for
    GNOME) - something which would appear to be enough of a solution for
    Windows developers, for example, but which would be blatantly
    inappropriate for users of those other desktop environments. Still, I'd
    be interested/impressed to learn otherwise, and I guess that this
    project provides the API concerned:

    https://jdic.dev.java.net/

    There is a package for Python which supports the different
    freedesktop.org standards, but I'm not sure whether it provides exactly
    the support requested:

    http://freedesktop.org/wiki/Software/pyxdg

    Generally, desktop integration in Python's standard library has been
    restricted to things like Web browser invocation, but I'd like to
    expand the desktop module to include other common desktop environment
    facilities:

    http://www.python.org/pypi/desktop

    In short, there is probably no standard library solution for this
    problem. Cross-platform frameworks like PyQt may offer access to
    desktop information, but I'm not completely convinced of that. I
    suppose we all just have to work a bit harder to address this need.

    Paul
     
    Paul Boddie, Aug 28, 2006
    #5
  6. Paul Boddie schrieb:
    > neoedmund wrote:
    >
    > [File icons for a given content type]
    >
    >> So what? Java 5.0 has the method, why python has not?

    >
    > I'd be generally surprised if whichever Java API responsible for this
    > managed to work it out correctly for the different free desktop
    > environments (KDE, GNOME, etc.)


    Just because nobody said it so far (although it's probably obvious
    to everybody): I doubt neoedmund is talking about free desktop
    environments...

    Regards,
    Martin
     
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=, Aug 28, 2006
    #6
  7. neoedmund a écrit :
    <ot>please don't top-post (corrected)</ot>
    > Bruno Desthuilliers wrote:
    >
    >>neoedmund wrote:
    >><ot>Please repeat the whole question in the message body</ot>
    >>
    >>=>how to get the os file icon for a given content-type?
    >>
    >>>any simple method?

    >>
    >>This is specific to your OS (and FWIW, there's nothing like a "file
    >>icon" on the OS I'm using).
    >>

    > So what? Java 5.0 has the method, why python has not?


    There are a lot of things that Java has an Python don't. And a lot of
    things that Python has and Java don't.

    And FWIW, I'd really like to know how the Java implementation of such a
    'feature' would work on a system where there's *no* 'os file icon'
    associated to a given content-type.
     
    Bruno Desthuilliers, Aug 28, 2006
    #7
  8. Martin v. Löwis a écrit :
    > Paul Boddie schrieb:
    >
    >>neoedmund wrote:
    >>
    >>[File icons for a given content type]
    >>
    >>
    >>>So what? Java 5.0 has the method, why python has not?

    >>
    >>I'd be generally surprised if whichever Java API responsible for this
    >>managed to work it out correctly for the different free desktop
    >>environments (KDE, GNOME, etc.)

    >
    >
    > Just because nobody said it so far (although it's probably obvious
    > to everybody): I doubt neoedmund is talking about free desktop
    > environments...


    Which bring us back to my first answer : this is OS-specific.

    > Regards,
    > Martin
     
    Bruno Desthuilliers, Aug 28, 2006
    #8
  9. neoedmund a écrit :
    > So what? Java 5.0 has the method, why python has not?


    Sidenote : I didn't say it was not possible in Python. Just that it's OS
    (or desktop-manager) specific, so you have to check your OS (or
    desktop-manager) API documentation.
     
    Bruno Desthuilliers, Aug 28, 2006
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Miro Durcik

    app.rc resource's icon to .net Icon

    Miro Durcik, Oct 9, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    1,402
    Miro Durcik
    Oct 9, 2004
  2. Lord0
    Replies:
    1
    Views:
    573
    Thomas Weidenfeller
    Apr 19, 2006
  3. Stanimir Stamenkov
    Replies:
    2
    Views:
    749
    Stanimir Stamenkov
    Oct 25, 2005
  4. Dan Polansky
    Replies:
    3
    Views:
    816
    Larry Barowski
    Feb 12, 2007
  5. Bodi
    Replies:
    1
    Views:
    292
    Lasse Reichstein Nielsen
    Nov 18, 2003
Loading...

Share This Page