Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > how to get the os file icon for a given content-type?

Reply
Thread Tools

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

 
 
neoedmund
Guest
Posts: n/a
 
      08-28-2006
any simple method?

 
Reply With Quote
 
 
 
 
Bruno Desthuilliers
Guest
Posts: n/a
 
      08-28-2006
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 '(E-Mail Removed)'.split('@')])"
 
Reply With Quote
 
 
 
 
neoedmund
Guest
Posts: n/a
 
      08-28-2006
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 '(E-Mail Removed)'.split('@')])"


 
Reply With Quote
 
Fredrik Lundh
Guest
Posts: n/a
 
      08-28-2006
"neoedmund" <(E-Mail Removed)> 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>



 
Reply With Quote
 
Paul Boddie
Guest
Posts: n/a
 
      08-28-2006
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

 
Reply With Quote
 
=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
Guest
Posts: n/a
 
      08-28-2006
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
 
Reply With Quote
 
Bruno Desthuilliers
Guest
Posts: n/a
 
      08-28-2006
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.
 
Reply With Quote
 
Bruno Desthuilliers
Guest
Posts: n/a
 
      08-28-2006
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

 
Reply With Quote
 
Bruno Desthuilliers
Guest
Posts: n/a
 
      08-28-2006
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Has thought been given given to a cleaned up C? Possibly called C+. Casey Hawthorne C Programming 385 04-04-2010 02:11 AM
" Given BACK what was freely GIVEN " 2Barter.net C++ 0 12-13-2006 02:56 AM
Days in a given date range for a given month......... Lord0 Java 1 04-19-2006 04:54 PM
generate all possible strings of given length given a set of characters chiara C Programming 6 10-06-2005 01:43 AM



Advertisments