public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] Hello! && portage UI
@ 2006-03-13 22:39 tvali
  2006-03-14  0:54 ` Brian
  0 siblings, 1 reply; 18+ messages in thread
From: tvali @ 2006-03-13 22:39 UTC (permalink / raw
  To: gentoo-portage-dev

[-- Attachment #1: Type: text/plain, Size: 2406 bytes --]

Hello!

I am thinking about making user interface for portage.

I see the possibility to browse portage tree, turning different filters on
and off, as it's most important feature. I dont think that it should contain
any functions for updating, emerging or unmerging or syncing at it's
beginning, as i think that i havent used portage long enough to make a clear
design of such a tool.

Anyway, package browser would be usable for me as a new user of portage.

I describe shortly, what i see as it's functionality:
* General UI, which looks like a classical e-mail client with folder-list on
left panel, mail-list on top and one e-mail on bottom. Additionally, top and
bottom panel should be together in right panel.
* Left panel contains 2 main folders -- one is to access folders in
/usr/portage/, another contains keywords like kdebase-meta (or kde-base) --
which has packages like kdegraphics-meta inside it (click +). This other
tree should be hand-made tree + "others" folder, last containing all package
groups, which are not included in this tree. At least, i think that
automation may not be possible -- it depends on structure, which i dont
know.
* Right panel, which contains tabs -- first tab is for top/bottom panels,
other are web browsers (konqueror).
* Top panel contains package list like detailed view of folders
* Botton panel contains details -- also button for opening www-address of
package in new tab.
+ there should be search feature.
+ some special folders should be added: --update world, which contains all
outdated packages jpc. As it would be slow, portage or this UI should be
cache such things and clean this cache when --sync happens.

It is possible that integration into Konqueror could be simple and usable
(like portage:/ protocol).

In future, additional features like tray-icon for autosync and
notifications, also adding packages to world and removing, could be
considered; code should be build in such way that is would be possible to
add them later in different ways.

--
tvali
(e-mail: "qtvali@gmail.com"; msn: "qtvali@gmail.com";
icq: "317-492-912")

Ühe eesti internetifirma lehel kohtasin tsitaati:
If you don't do it excellently, dont do it at all. Because if it's not
excellent, it won't be profitable or fun, and if you're not in business for
fun or profit, what the hell are you doing here?
Robert Townsend

[-- Attachment #2: Type: text/html, Size: 2631 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [gentoo-portage-dev] Hello! && portage UI
  2006-03-13 22:39 [gentoo-portage-dev] Hello! && portage UI tvali
@ 2006-03-14  0:54 ` Brian
  2006-03-14 11:14   ` tvali
  0 siblings, 1 reply; 18+ messages in thread
From: Brian @ 2006-03-14  0:54 UTC (permalink / raw
  To: gentoo-portage-dev

On Tue, 2006-14-03 at 00:39 +0200, tvali wrote:
> Hello!
> 
> I am thinking about making user interface for portage.
> 
> I see the possibility to browse portage tree, turning different
> filters on and off, as it's most important feature. I dont think that
> it should contain any functions for updating, emerging or unmerging or
> syncing at it's beginning, as i think that i havent used portage long
> enough to make a clear design of such a tool.
> 
> Anyway, package browser would be usable for me as a new user of
> portage.
> 
> I describe shortly, what i see as it's functionality:
> * General UI, which looks like a classical e-mail client with
> folder-list on left panel, mail-list on top and one e-mail on bottom.
> Additionally, top and bottom panel should be together in right panel.
> * Left panel contains 2 main folders -- one is to access folders
> in /usr/portage/, another contains keywords like kdebase-meta (or
> kde-base) -- which has packages like kdegraphics-meta inside it (click
> +). This other tree should be hand-made tree + "others" folder, last
> containing all package groups, which are not included in this tree. At
> least, i think that automation may not be possible -- it depends on
> structure, which i dont know.
> * Right panel, which contains tabs -- first tab is for top/bottom
> panels, other are web browsers (konqueror).
> * Top panel contains package list like detailed view of folders
> * Botton panel contains details -- also button for opening www-address
> of package in new tab.
> + there should be search feature.
> + some special folders should be added: --update world, which contains
> all outdated packages jpc. As it would be slow, portage or this UI
> should be cache such things and clean this cache when --sync happens.
> 
> It is possible that integration into Konqueror could be simple and
> usable (like portage:/ protocol).
> 
> In future, additional features like tray-icon for autosync and
> notifications, also adding packages to world and removing, could be
> considered; code should be build in such way that is would be possible
> to add them later in different ways.
> 
> -- 
> tvali

For KDE there are 2 projects that come to mind Kuroo, and another one
that was designed to run in Konguerer, but I don't remember the name.
Kuroo is being actively developed right now, I don't recall seeing
anything recently on the other one.

If your thinking of something being coded in python so that it can
interact with and use portage code for information retrieval then check
out Porthole.  It is a gtk app not KDE, but will run on a KDE desktop.
It sounds like it already does things similar to what you had in mind.

If you wanted to port the gui code from pygtk to pyQt, I am sure that
there would be a number of KDE users that would be pleased.  I would
definitely consider adding an optional KDE interface to it. :)


-- 
Brian <dol-sen@telus.net>

-- 
gentoo-portage-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [gentoo-portage-dev] Hello! && portage UI
  2006-03-14  0:54 ` Brian
@ 2006-03-14 11:14   ` tvali
  2006-03-14 14:39     ` Brian
  0 siblings, 1 reply; 18+ messages in thread
From: tvali @ 2006-03-14 11:14 UTC (permalink / raw
  To: gentoo-portage-dev

[-- Attachment #1: Type: text/plain, Size: 1817 bytes --]

Ok, i was, yes, speaking about kde.

I will check out this Porthole :) I was actually thinking more about c++,
but nothing against python -- i was quite a fan of python when i first found
it.

I'm new to gentoo, so could you tell me, where i find some clear manual for
doing the following:
* Download gentoo source of Porthole
* Change that source
* Build my version of it in such way that my portage tree is OK after that

Are --fetchonly and --usepkgonly somehow related to that?

2006/3/14, Brian <dol-sen@telus.net>:
>
> On Tue, 2006-14-03 at 00:39 +0200, tvali wrote:
> For KDE there are 2 projects that come to mind Kuroo, and another one
> that was designed to run in Konguerer, but I don't remember the name.
> Kuroo is being actively developed right now, I don't recall seeing
> anything recently on the other one.
>
> If your thinking of something being coded in python so that it can
> interact with and use portage code for information retrieval then check
> out Porthole.  It is a gtk app not KDE, but will run on a KDE desktop.
> It sounds like it already does things similar to what you had in mind.
>
> If you wanted to port the gui code from pygtk to pyQt, I am sure that
> there would be a number of KDE users that would be pleased.  I would
> definitely consider adding an optional KDE interface to it. :)
>
>
> --
> Brian <dol-sen@telus.net>
>
> --
> gentoo-portage-dev@gentoo.org mailing list
>
>


--
tvali
(e-mail: "qtvali@gmail.com"; msn: "qtvali@gmail.com";
icq: "317-492-912")

Ühe eesti internetifirma lehel kohtasin tsitaati:
If you don't do it excellently, dont do it at all. Because if it's not
excellent, it won't be profitable or fun, and if you're not in business for
fun or profit, what the hell are you doing here?
Robert Townsend

[-- Attachment #2: Type: text/html, Size: 2355 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [gentoo-portage-dev] Hello! && portage UI
  2006-03-14 11:14   ` tvali
@ 2006-03-14 14:39     ` Brian
  2006-03-14 14:55       ` tvali
  2006-03-14 15:18       ` Marius Mauch
  0 siblings, 2 replies; 18+ messages in thread
From: Brian @ 2006-03-14 14:39 UTC (permalink / raw
  To: gentoo-portage-dev

On Tue, 2006-14-03 at 13:14 +0200, tvali wrote:
> Ok, i was, yes, speaking about kde.
> 
> I will check out this Porthole :) I was actually thinking more about c
> ++, but nothing against python -- i was quite a fan of python when i
> first found it.

I believe Kuroo is in C, maybe c++
> 
> I'm new to gentoo, so could you tell me, where i find some clear
> manual for doing the following:
> * Download gentoo source of Porthole

First I would unmask it and emerge it so that you have all dependencies
installed.  enable the debug use flag or emerge pycrash-0.43 separately.

# echo =app-portage/porthole-0.5.0 /etc/portage/package.unmask
# echo app-portage/porthole /etc/portage/package.keywords
# emerge porthole

If you like it and want to make a kde interface for it,

Go to our sourceforge page and do a cvs checkout.
http://sourceforge.net/projects/porthole/

> * Change that source

cd into the directory, edit as desired

> * Build my version of it in such way that my portage tree is OK after
> that
> 
then run it from a terminal:

# ./porthole -l -d


Also sign up to the 2 mail lists for porthole so we can discuss any
problems, etc..  This list is for portage development.

Then any changes can be diffed for commit.

cvs diff -u > somefile

Of course I will have to make changes to the interface loading so that
your changes won't kill the gtk interface code.


> Are --fetchonly and --usepkgonly somehow related to that?
> 
--fetchonly will just get the tarball downloaded into the distfiles
directory.

--usepkgonly is for telling emerge to use binary packages only.


> 2006/3/14, Brian <dol-sen@telus.net>:
>         On Tue, 2006-14-03 at 00:39 +0200, tvali wrote:
>         For KDE there are 2 projects that come to mind Kuroo, and
>         another one
>         that was designed to run in Konguerer, but I don't remember
>         the name.
>         Kuroo is being actively developed right now, I don't recall
>         seeing 
>         anything recently on the other one.
>         
>         If your thinking of something being coded in python so that it
>         can
>         interact with and use portage code for information retrieval
>         then check
>         out Porthole.  It is a gtk app not KDE, but will run on a KDE
>         desktop. 
>         It sounds like it already does things similar to what you had
>         in mind.
>         
>         If you wanted to port the gui code from pygtk to pyQt, I am
>         sure that
>         there would be a number of KDE users that would be pleased.  I
>         would 
>         definitely consider adding an optional KDE interface to it. :)
>         
>         
>         --
>         Brian <dol-sen@telus.net>
>         
>         --
>         gentoo-portage-dev@gentoo.org mailing list
>         
> 
> 
> 
> -- 
> tvali
> (e-mail: "qtvali@gmail.com"; msn: "qtvali@gmail.com";
> icq: "317-492-912")
> 
> Ühe eesti internetifirma lehel kohtasin tsitaati:
> If you don't do it excellently, dont do it at all. Because if it's not
> excellent, it won't be profitable or fun, and if you're not in
> business for fun or profit, what the hell are you doing here?
> Robert Townsend
-- 
Brian <dol-sen@telus.net>

-- 
gentoo-portage-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [gentoo-portage-dev] Hello! && portage UI
  2006-03-14 14:39     ` Brian
@ 2006-03-14 14:55       ` tvali
  2006-03-14 15:07         ` Brian
  2006-03-14 15:18       ` Marius Mauch
  1 sibling, 1 reply; 18+ messages in thread
From: tvali @ 2006-03-14 14:55 UTC (permalink / raw
  To: gentoo-portage-dev

Ok, i will finish this chat about making portage cache, then learn
portage code, then write basic sql modules and when this thing is
running, i am more able to be involved in portage GUI as i can
understand background of portage, then ...i hope you have time to wait
for me :)

2006/3/14, Brian <dol-sen@telus.net>:
> On Tue, 2006-14-03 at 13:14 +0200, tvali wrote:
> > Ok, i was, yes, speaking about kde.
> >
> > I will check out this Porthole :) I was actually thinking more about c
> > ++, but nothing against python -- i was quite a fan of python when i
> > first found it.
>
> I believe Kuroo is in C, maybe c++
> >
> > I'm new to gentoo, so could you tell me, where i find some clear
> > manual for doing the following:
> > * Download gentoo source of Porthole
>
> First I would unmask it and emerge it so that you have all dependencies
> installed.  enable the debug use flag or emerge pycrash-0.43 separately.
>
> # echo =app-portage/porthole-0.5.0 /etc/portage/package.unmask
> # echo app-portage/porthole /etc/portage/package.keywords
> # emerge porthole
>
> If you like it and want to make a kde interface for it,
>
> Go to our sourceforge page and do a cvs checkout.
> http://sourceforge.net/projects/porthole/
>
> > * Change that source
>
> cd into the directory, edit as desired
>
> > * Build my version of it in such way that my portage tree is OK after
> > that
> >
> then run it from a terminal:
>
> # ./porthole -l -d
>
>
> Also sign up to the 2 mail lists for porthole so we can discuss any
> problems, etc..  This list is for portage development.
>
> Then any changes can be diffed for commit.
>
> cvs diff -u > somefile
>
> Of course I will have to make changes to the interface loading so that
> your changes won't kill the gtk interface code.
>
>
> > Are --fetchonly and --usepkgonly somehow related to that?
> >
> --fetchonly will just get the tarball downloaded into the distfiles
> directory.
>
> --usepkgonly is for telling emerge to use binary packages only.
>
>
> > 2006/3/14, Brian <dol-sen@telus.net>:
> >         On Tue, 2006-14-03 at 00:39 +0200, tvali wrote:
> >         For KDE there are 2 projects that come to mind Kuroo, and
> >         another one
> >         that was designed to run in Konguerer, but I don't remember
> >         the name.
> >         Kuroo is being actively developed right now, I don't recall
> >         seeing
> >         anything recently on the other one.
> >
> >         If your thinking of something being coded in python so that it
> >         can
> >         interact with and use portage code for information retrieval
> >         then check
> >         out Porthole.  It is a gtk app not KDE, but will run on a KDE
> >         desktop.
> >         It sounds like it already does things similar to what you had
> >         in mind.
> >
> >         If you wanted to port the gui code from pygtk to pyQt, I am
> >         sure that
> >         there would be a number of KDE users that would be pleased.  I
> >         would
> >         definitely consider adding an optional KDE interface to it. :)
> >
> >
> >         --
> >         Brian <dol-sen@telus.net>
> >
> >         --
> >         gentoo-portage-dev@gentoo.org mailing list
> >
> >
> >
> >
> > --
> > tvali
> > (e-mail: "qtvali@gmail.com"; msn: "qtvali@gmail.com";
> > icq: "317-492-912")
> >
> > Ühe eesti internetifirma lehel kohtasin tsitaati:
> > If you don't do it excellently, dont do it at all. Because if it's not
> > excellent, it won't be profitable or fun, and if you're not in
> > business for fun or profit, what the hell are you doing here?
> > Robert Townsend
> --
> Brian <dol-sen@telus.net>
>
> --
> gentoo-portage-dev@gentoo.org mailing list
>
>


--
tvali
(e-mail: "qtvali@gmail.com"; msn: "qtvali@gmail.com";
icq: "317-492-912")

Ühe eesti internetifirma lehel kohtasin tsitaati:
If you don't do it excellently, dont do it at all. Because if it's not
excellent, it won't be profitable or fun, and if you're not in
business for fun or profit, what the hell are you doing here?
Robert Townsend

-- 
gentoo-portage-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [gentoo-portage-dev] Hello! && portage UI
  2006-03-14 14:55       ` tvali
@ 2006-03-14 15:07         ` Brian
  0 siblings, 0 replies; 18+ messages in thread
From: Brian @ 2006-03-14 15:07 UTC (permalink / raw
  To: gentoo-portage-dev

On Tue, 2006-14-03 at 16:55 +0200, tvali wrote:
> Ok, i will finish this chat about making portage cache, then learn
> portage code, then write basic sql modules and when this thing is
> running, i am more able to be involved in portage GUI as i can
> understand background of portage, then ...i hope you have time to wait
> for me :)
> 

I have lots of time to wait for you... just don't have much time for
coding :(

-- 
Brian <dol-sen@telus.net>

-- 
gentoo-portage-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [gentoo-portage-dev] Hello! && portage UI
  2006-03-14 14:39     ` Brian
  2006-03-14 14:55       ` tvali
@ 2006-03-14 15:18       ` Marius Mauch
  2006-03-14 16:48         ` tvali
  1 sibling, 1 reply; 18+ messages in thread
From: Marius Mauch @ 2006-03-14 15:18 UTC (permalink / raw
  To: gentoo-portage-dev

Brian wrote:
> On Tue, 2006-14-03 at 13:14 +0200, tvali wrote:
> 
>>Ok, i was, yes, speaking about kde.
>>
>>I will check out this Porthole :) I was actually thinking more about c
>>++, but nothing against python -- i was quite a fan of python when i
>>first found it.
> 
> 
> I believe Kuroo is in C, maybe c++

For the record: Kuroo is known to be conceptually broken (uses the cache 
directly), but the author is looking to fix that in a future version.
Generally writing portage utils in languages other than python is 
difficult as you can't use the primary API directly.

Marius
-- 
gentoo-portage-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [gentoo-portage-dev] Hello! && portage UI
  2006-03-14 15:18       ` Marius Mauch
@ 2006-03-14 16:48         ` tvali
  2006-03-14 16:55           ` tvali
  2006-03-15  9:51           ` Paul de Vrieze
  0 siblings, 2 replies; 18+ messages in thread
From: tvali @ 2006-03-14 16:48 UTC (permalink / raw
  To: gentoo-portage-dev

2006/3/14, Marius Mauch <genone@gentoo.org>:
> Brian wrote:
> > On Tue, 2006-14-03 at 13:14 +0200, tvali wrote:
> >
> >>Ok, i was, yes, speaking about kde.
> >>
> >>I will check out this Porthole :) I was actually thinking more about c
> >>++, but nothing against python -- i was quite a fan of python when i
> >>first found it.
> >
> >
> > I believe Kuroo is in C, maybe c++
>
> For the record: Kuroo is known to be conceptually broken (uses the cache
> directly), but the author is looking to fix that in a future version.
> Generally writing portage utils in languages other than python is
> difficult as you can't use the primary API directly.

There seems not to be c++ bintings to python, anyway there is
dev-python/sip. I havent done such thing, but i suppose that it would
not be impossible to start portage inside Kuroo as a thread, then
interact with this thread, having sip between them. If it's used for
creation of PyQt, such two-way interaction should be possible.

http://www.riverbankcomputing.co.uk/sip/index.php

> Marius
> --
> gentoo-portage-dev@gentoo.org mailing list
>
>


--
tvali
(e-mail: "qtvali@gmail.com"; msn: "qtvali@gmail.com";
icq: "317-492-912")

Ühe eesti internetifirma lehel kohtasin tsitaati:
If you don't do it excellently, dont do it at all. Because if it's not
excellent, it won't be profitable or fun, and if you're not in
business for fun or profit, what the hell are you doing here?
Robert Townsend

-- 
gentoo-portage-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [gentoo-portage-dev] Hello! && portage UI
  2006-03-14 16:48         ` tvali
@ 2006-03-14 16:55           ` tvali
  2006-03-15  9:51           ` Paul de Vrieze
  1 sibling, 0 replies; 18+ messages in thread
From: tvali @ 2006-03-14 16:55 UTC (permalink / raw
  To: gentoo-portage-dev

I looked over that:

SIP also makes it easy to take a Python application (maybe a
prototype) and selectively implement parts of the application (maybe
for performance reasons) in C or C++.

This could mean that portage could be made fully compatible with c++
app? Again, havent tried/tested, just assuming :)

2006/3/14, tvali <qtvali@gmail.com>:
> 2006/3/14, Marius Mauch <genone@gentoo.org>:
> > Brian wrote:
> > > On Tue, 2006-14-03 at 13:14 +0200, tvali wrote:
> > >
> > >>Ok, i was, yes, speaking about kde.
> > >>
> > >>I will check out this Porthole :) I was actually thinking more about c
> > >>++, but nothing against python -- i was quite a fan of python when i
> > >>first found it.
> > >
> > >
> > > I believe Kuroo is in C, maybe c++
> >
> > For the record: Kuroo is known to be conceptually broken (uses the cache
> > directly), but the author is looking to fix that in a future version.
> > Generally writing portage utils in languages other than python is
> > difficult as you can't use the primary API directly.
>
> There seems not to be c++ bintings to python, anyway there is
> dev-python/sip. I havent done such thing, but i suppose that it would
> not be impossible to start portage inside Kuroo as a thread, then
> interact with this thread, having sip between them. If it's used for
> creation of PyQt, such two-way interaction should be possible.
>
> http://www.riverbankcomputing.co.uk/sip/index.php
>
> > Marius
> > --
> > gentoo-portage-dev@gentoo.org mailing list
> >
> >
>
>
> --
> tvali
> (e-mail: "qtvali@gmail.com"; msn: "qtvali@gmail.com";
> icq: "317-492-912")
>
> Ühe eesti internetifirma lehel kohtasin tsitaati:
> If you don't do it excellently, dont do it at all. Because if it's not
> excellent, it won't be profitable or fun, and if you're not in
> business for fun or profit, what the hell are you doing here?
> Robert Townsend
>


--
tvali
(e-mail: "qtvali@gmail.com"; msn: "qtvali@gmail.com";
icq: "317-492-912")

Ühe eesti internetifirma lehel kohtasin tsitaati:
If you don't do it excellently, dont do it at all. Because if it's not
excellent, it won't be profitable or fun, and if you're not in
business for fun or profit, what the hell are you doing here?
Robert Townsend

-- 
gentoo-portage-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [gentoo-portage-dev] Hello! && portage UI
  2006-03-14 16:48         ` tvali
  2006-03-14 16:55           ` tvali
@ 2006-03-15  9:51           ` Paul de Vrieze
  2006-03-15 14:52             ` solar
  1 sibling, 1 reply; 18+ messages in thread
From: Paul de Vrieze @ 2006-03-15  9:51 UTC (permalink / raw
  To: gentoo-portage-dev

[-- Attachment #1: Type: text/plain, Size: 1354 bytes --]

On Tuesday 14 March 2006 17:48, tvali wrote:
> 2006/3/14, Marius Mauch <genone@gentoo.org>:
> > Brian wrote:
> > > On Tue, 2006-14-03 at 13:14 +0200, tvali wrote:
> > >>Ok, i was, yes, speaking about kde.
> > >>
> > >>I will check out this Porthole :) I was actually thinking more
> > >> about c ++, but nothing against python -- i was quite a fan of
> > >> python when i first found it.
> > >
> > > I believe Kuroo is in C, maybe c++
> >
> > For the record: Kuroo is known to be conceptually broken (uses the
> > cache directly), but the author is looking to fix that in a future
> > version. Generally writing portage utils in languages other than
> > python is difficult as you can't use the primary API directly.
>
> There seems not to be c++ bintings to python, anyway there is
> dev-python/sip. I havent done such thing, but i suppose that it would
> not be impossible to start portage inside Kuroo as a thread, then
> interact with this thread, having sip between them. If it's used for
> creation of PyQt, such two-way interaction should be possible.

Actually, C++ being strongly related to C, can just use the C python 
api's. As such it could directly interface with python, and use the 
python portage api.

Paul

-- 
Paul de Vrieze
Gentoo Developer
Mail: pauldv@gentoo.org
Homepage: http://www.devrieze.net

[-- Attachment #2: Type: application/pgp-signature, Size: 200 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [gentoo-portage-dev] Hello! && portage UI
  2006-03-15  9:51           ` Paul de Vrieze
@ 2006-03-15 14:52             ` solar
  2006-03-15 15:12               ` tvali
  2006-03-15 20:42               ` portage from C (was Re: [gentoo-portage-dev] Hello! && portage UI) Kevin F. Quinn (Gentoo)
  0 siblings, 2 replies; 18+ messages in thread
From: solar @ 2006-03-15 14:52 UTC (permalink / raw
  To: gentoo-portage-dev

On Wed, 2006-03-15 at 10:51 +0100, Paul de Vrieze wrote:

[snip]

> Actually, C++ being strongly related to C, can just use the C python 
> api's. As such it could directly interface with python, and use the 
> python portage api.

If you could demonstrate an 'import portage' and a simple
printf("PORTDIR=%s\n", PORTDIR); in C I'd be highly interested.

-- 
solar <solar@gentoo.org>
Gentoo Linux

-- 
gentoo-portage-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [gentoo-portage-dev] Hello! && portage UI
  2006-03-15 14:52             ` solar
@ 2006-03-15 15:12               ` tvali
  2006-03-15 16:36                 ` solar
  2006-03-15 20:42               ` portage from C (was Re: [gentoo-portage-dev] Hello! && portage UI) Kevin F. Quinn (Gentoo)
  1 sibling, 1 reply; 18+ messages in thread
From: tvali @ 2006-03-15 15:12 UTC (permalink / raw
  To: gentoo-portage-dev

Could :P

Python has this interactive interpreter, what every scripting language has.

If you are able to run command-line app, send keyboard input and catch
it's output, you're done with it.

You can also write some small python function, which will parse python
variables into some form, which you can simply parse into something,
what is easily readable in C.

2006/3/15, solar <solar@gentoo.org>:
> On Wed, 2006-03-15 at 10:51 +0100, Paul de Vrieze wrote:
>
> [snip]
>
> > Actually, C++ being strongly related to C, can just use the C python
> > api's. As such it could directly interface with python, and use the
> > python portage api.
>
> If you could demonstrate an 'import portage' and a simple
> printf("PORTDIR=%s\n", PORTDIR); in C I'd be highly interested.
>
> --
> solar <solar@gentoo.org>
> Gentoo Linux
>
> --
> gentoo-portage-dev@gentoo.org mailing list
>
>


--
tvali
(e-mail: "qtvali@gmail.com"; msn: "qtvali@gmail.com";
icq: "317-492-912")

Ühe eesti internetifirma lehel kohtasin tsitaati:
If you don't do it excellently, dont do it at all. Because if it's not
excellent, it won't be profitable or fun, and if you're not in
business for fun or profit, what the hell are you doing here?
Robert Townsend

-- 
gentoo-portage-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [gentoo-portage-dev] Hello! && portage UI
  2006-03-15 15:12               ` tvali
@ 2006-03-15 16:36                 ` solar
  2006-03-15 17:36                   ` tvali
  0 siblings, 1 reply; 18+ messages in thread
From: solar @ 2006-03-15 16:36 UTC (permalink / raw
  To: gentoo-portage-dev

On Wed, 2006-03-15 at 17:12 +0200, tvali wrote:
> Could :P
> 
> Python has this interactive interpreter, what every scripting language has.

... 

> If you are able to run command-line app, send keyboard input and catch
> it's output, you're done with it.
> 
> You can also write some small python function, which will parse python
> variables into some form, which you can simply parse into something,
> what is easily readable in C.

An example please. 5 lines of code have more meaning than ~30 emails on 
the topic that simply state 'it can be done'


> 2006/3/15, solar <solar@gentoo.org>:
> > On Wed, 2006-03-15 at 10:51 +0100, Paul de Vrieze wrote:
> >
> > [snip]
> >
> > > Actually, C++ being strongly related to C, can just use the C python
> > > api's. As such it could directly interface with python, and use the
> > > python portage api.
> >
> > If you could demonstrate an 'import portage' and a simple
> > printf("PORTDIR=%s\n", PORTDIR); in C I'd be highly interested.
> >
> > --
> > solar <solar@gentoo.org>
> > Gentoo Linux
> >
> > --
> > gentoo-portage-dev@gentoo.org mailing list
> >
> >
> 
> 
> --
> tvali
> (e-mail: "qtvali@gmail.com"; msn: "qtvali@gmail.com";
> icq: "317-492-912")
> 
> Ühe eesti internetifirma lehel kohtasin tsitaati:
> If you don't do it excellently, dont do it at all. Because if it's not
> excellent, it won't be profitable or fun, and if you're not in
> business for fun or profit, what the hell are you doing here?
> Robert Townsend
> 
-- 
solar <solar@gentoo.org>
Gentoo Linux

-- 
gentoo-portage-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [gentoo-portage-dev] Hello! && portage UI
  2006-03-15 16:36                 ` solar
@ 2006-03-15 17:36                   ` tvali
  0 siblings, 0 replies; 18+ messages in thread
From: tvali @ 2006-03-15 17:36 UTC (permalink / raw
  To: gentoo-portage-dev

Not so simply :)

This is a clear way, i think. I havent c++ installed right now as it
gives some errors and i havent too much urge yet.

Anyway, with piping..
python > /root/test.out < /root/test.in

You can write things like "import module" to test.in, then use result
from test.out.

I did write words "print 'hello!'" to test.in, which left 1 word
"hello" into test.out -- of course it's slower than getting it work as
realtime interaction :)

http://www.math.mcgill.ca/services/linux_basics.php -- there is also
command1 | command2 for piping between apps.

Tcl script: http://www.cs.mun.ca/~donald/msc/node72.html

When i get kdevelop to work here, i will look this thing more and
produce some code -- i like it more than Kate :) Anyway, i think that
it shouldnt be hard at all :) And using io files, it's achievable now,
too.

2006/3/15, solar <solar@gentoo.org>:
> On Wed, 2006-03-15 at 17:12 +0200, tvali wrote:
> > Could :P
> >
> > Python has this interactive interpreter, what every scripting language has.
>
> ...
>
> > If you are able to run command-line app, send keyboard input and catch
> > it's output, you're done with it.
> >
> > You can also write some small python function, which will parse python
> > variables into some form, which you can simply parse into something,
> > what is easily readable in C.
>
> An example please. 5 lines of code have more meaning than ~30 emails on
> the topic that simply state 'it can be done'
>
>
> > 2006/3/15, solar <solar@gentoo.org>:
> > > On Wed, 2006-03-15 at 10:51 +0100, Paul de Vrieze wrote:
> > >
> > > [snip]
> > >
> > > > Actually, C++ being strongly related to C, can just use the C python
> > > > api's. As such it could directly interface with python, and use the
> > > > python portage api.
> > >
> > > If you could demonstrate an 'import portage' and a simple
> > > printf("PORTDIR=%s\n", PORTDIR); in C I'd be highly interested.
> > >
> > > --
> > > solar <solar@gentoo.org>
> > > Gentoo Linux
> > >
> > > --
> > > gentoo-portage-dev@gentoo.org mailing list
> > >
> > >
> >
> >
> > --
> > tvali
> > (e-mail: "qtvali@gmail.com"; msn: "qtvali@gmail.com";
> > icq: "317-492-912")
> >
> > Ühe eesti internetifirma lehel kohtasin tsitaati:
> > If you don't do it excellently, dont do it at all. Because if it's not
> > excellent, it won't be profitable or fun, and if you're not in
> > business for fun or profit, what the hell are you doing here?
> > Robert Townsend
> >
> --
> solar <solar@gentoo.org>
> Gentoo Linux
>
> --
> gentoo-portage-dev@gentoo.org mailing list
>
>


--
tvali
(e-mail: "qtvali@gmail.com"; msn: "qtvali@gmail.com";
icq: "317-492-912")

Ühe eesti internetifirma lehel kohtasin tsitaati:
If you don't do it excellently, dont do it at all. Because if it's not
excellent, it won't be profitable or fun, and if you're not in
business for fun or profit, what the hell are you doing here?
Robert Townsend

-- 
gentoo-portage-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 18+ messages in thread

* portage from C (was Re: [gentoo-portage-dev] Hello! && portage UI)
  2006-03-15 14:52             ` solar
  2006-03-15 15:12               ` tvali
@ 2006-03-15 20:42               ` Kevin F. Quinn (Gentoo)
  2006-03-15 21:37                 ` solar
  1 sibling, 1 reply; 18+ messages in thread
From: Kevin F. Quinn (Gentoo) @ 2006-03-15 20:42 UTC (permalink / raw
  To: gentoo-portage-dev


[-- Attachment #1.1: Type: text/plain, Size: 801 bytes --]

On Wed, 15 Mar 2006 09:52:13 -0500
solar <solar@gentoo.org> wrote:

> On Wed, 2006-03-15 at 10:51 +0100, Paul de Vrieze wrote:
> 
> [snip]
> 
> > Actually, C++ being strongly related to C, can just use the C
> > python api's. As such it could directly interface with python, and
> > use the python portage api.
> 
> If you could demonstrate an 'import portage' and a simple
> printf("PORTDIR=%s\n", PORTDIR); in C I'd be highly interested.

Try attached :)  Had a go 'coz I was curious.  Compile with:

gcc -o getportdir getportdir.c -lpython2.4

Does the equivalent of:

#!/usr/bin/portage
import portage;
print portage.settings["PORTDIR"];

(more or less).  Docs on the API itself (which comes with Python) are at
http://docs.python.org/api/api.html

-- 
Kevin F. Quinn

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: getportdir.c --]
[-- Type: text/x-csrc; name=getportdir.c, Size: 777 bytes --]

#include <python2.4/Python.h>

#include <stdio.h>

int main(int argc, char **argv) {
	PyObject *portage, *portage_const, *portdir, *portage_dict, *portage_const_dict, portage_db;
	PyObject *portage_settings, *portage_settings_dict;

	PyObject *key, *value;
	int pos;

	Py_Initialize();

	portage = PyImport_ImportModule ("portage");

	portage_dict = PyModule_GetDict (portage);
	
	portage_settings = PyDict_GetItemString (portage_dict, "settings");
	// it's an instance of a class

	portdir = PyObject_GetItem (portage_settings, PyString_FromString("PORTDIR"));
	if (portdir == NULL) {
		fprintf(stderr, "Failed to find portdir\n");
	} else {
		fprintf(stdout, "PORTDIR=\"%s\"\n", PyString_AsString(portdir)); fflush(stdout);
	}

	Py_Finalize();
}

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 191 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: portage from C (was Re: [gentoo-portage-dev] Hello! && portage UI)
  2006-03-15 20:42               ` portage from C (was Re: [gentoo-portage-dev] Hello! && portage UI) Kevin F. Quinn (Gentoo)
@ 2006-03-15 21:37                 ` solar
  2006-03-15 22:12                   ` tvali
  0 siblings, 1 reply; 18+ messages in thread
From: solar @ 2006-03-15 21:37 UTC (permalink / raw
  To: gentoo-portage-dev

On Wed, 2006-03-15 at 21:42 +0100, Kevin F. Quinn (Gentoo) wrote:
> On Wed, 15 Mar 2006 09:52:13 -0500
> solar <solar@gentoo.org> wrote:
> 
> > On Wed, 2006-03-15 at 10:51 +0100, Paul de Vrieze wrote:
> > 
> > [snip]
> > 
> > > Actually, C++ being strongly related to C, can just use the C
> > > python api's. As such it could directly interface with python, and
> > > use the python portage api.
> > 
> > If you could demonstrate an 'import portage' and a simple
> > printf("PORTDIR=%s\n", PORTDIR); in C I'd be highly interested.
> 
> Try attached :)  Had a go 'coz I was curious.  Compile with:
> 
> gcc -o getportdir getportdir.c -lpython2.4
> 
> Does the equivalent of:
> 
> #!/usr/bin/portage
> import portage;
> print portage.settings["PORTDIR"];
> 
> (more or less).  Docs on the API itself (which comes with Python) are at
> http://docs.python.org/api/api.html

thanks Kevin,
 marienz also put 3 examples together to demonstrate it.

/me feels like a kid in a candy store.

thanks guys.


-- 
solar <solar@gentoo.org>
Gentoo Linux

-- 
gentoo-portage-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: portage from C (was Re: [gentoo-portage-dev] Hello! && portage UI)
  2006-03-15 21:37                 ` solar
@ 2006-03-15 22:12                   ` tvali
  2006-03-15 22:14                     ` tvali
  0 siblings, 1 reply; 18+ messages in thread
From: tvali @ 2006-03-15 22:12 UTC (permalink / raw
  To: gentoo-portage-dev

[-- Attachment #1: Type: text/plain, Size: 1824 bytes --]

So I was the last one :)

My example is using python interpreter -- it's maybe simpler to use in
many cases, but theoretically slower.

It is, anyway, not so advanced to import portage, but you can add that line ;)

2006/3/15, solar <solar@gentoo.org>:
> On Wed, 2006-03-15 at 21:42 +0100, Kevin F. Quinn (Gentoo) wrote:
> > On Wed, 15 Mar 2006 09:52:13 -0500
> > solar <solar@gentoo.org> wrote:
> >
> > > On Wed, 2006-03-15 at 10:51 +0100, Paul de Vrieze wrote:
> > >
> > > [snip]
> > >
> > > > Actually, C++ being strongly related to C, can just use the C
> > > > python api's. As such it could directly interface with python, and
> > > > use the python portage api.
> > >
> > > If you could demonstrate an 'import portage' and a simple
> > > printf("PORTDIR=%s\n", PORTDIR); in C I'd be highly interested.
> >
> > Try attached :)  Had a go 'coz I was curious.  Compile with:
> >
> > gcc -o getportdir getportdir.c -lpython2.4
> >
> > Does the equivalent of:
> >
> > #!/usr/bin/portage
> > import portage;
> > print portage.settings["PORTDIR"];
> >
> > (more or less).  Docs on the API itself (which comes with Python) are at
> > http://docs.python.org/api/api.html
>
> thanks Kevin,
>  marienz also put 3 examples together to demonstrate it.
>
> /me feels like a kid in a candy store.
>
> thanks guys.
>
>
> --
> solar <solar@gentoo.org>
> Gentoo Linux
>
> --
> gentoo-portage-dev@gentoo.org mailing list
>
>


--
tvali
(e-mail: "qtvali@gmail.com"; msn: "qtvali@gmail.com";
icq: "317-492-912")

Ühe eesti internetifirma lehel kohtasin tsitaati:
If you don't do it excellently, dont do it at all. Because if it's not
excellent, it won't be profitable or fun, and if you're not in
business for fun or profit, what the hell are you doing here?
Robert Townsend

[-- Attachment #2: pipe.c --]
[-- Type: text/x-csrc, Size: 1000 bytes --]


#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <wait.h>

void python(int input[2], int output[2]) {
        dup2(output[1], STDOUT_FILENO);
        dup2(input[0], STDIN_FILENO);
        close(output[0]);
        close(output[1]);
        close(input[0]);
        close(input[1]);
        char *const args[] = { "/usr/bin/python", NULL };
        execv(args[0], args);
        _exit(EXIT_FAILURE);
}

int main(int argc, char *argv[])
{
    int input[2];
    pipe(input);
    int output[2];
    pipe(output);

    if (fork() == 0) python(input, output);

    FILE *inputf, *outputf;

    close(output[1]);
    close(input[0]);
    outputf = fdopen(output[0], "r");
    inputf = fdopen(input[1], "w");

    fputs("print 123\n", inputf);
    fclose(inputf);

    char tt;
    for (tt=0; tt<40; tt++)
      fputc(tt, inputf);

    int c;
    while ((c = fgetc(outputf)) != EOF)
	  fputc(c, stdout);

    fputc(EOF, inputf);

    wait(NULL);
    return 0;
}




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: portage from C (was Re: [gentoo-portage-dev] Hello! && portage UI)
  2006-03-15 22:12                   ` tvali
@ 2006-03-15 22:14                     ` tvali
  0 siblings, 0 replies; 18+ messages in thread
From: tvali @ 2006-03-15 22:14 UTC (permalink / raw
  To: gentoo-portage-dev

sorry
lines
    char tt;
    for (tt=0; tt<40; tt++)
      fputc(tt, inputf);

/.../

    fputc(EOF, inputf);

are not needed at all and do nothing -- i was just testing a thought
before i catched how those pipes and forks work in linux :) i have
mostly done things in windows and c++ and WinApi so i dont catch
everything immedietly yet :)

2006/3/16, tvali <qtvali@gmail.com>:
> So I was the last one :)
>
> My example is using python interpreter -- it's maybe simpler to use in
> many cases, but theoretically slower.
>
> It is, anyway, not so advanced to import portage, but you can add that line ;)
>
> 2006/3/15, solar <solar@gentoo.org>:
> > On Wed, 2006-03-15 at 21:42 +0100, Kevin F. Quinn (Gentoo) wrote:
> > > On Wed, 15 Mar 2006 09:52:13 -0500
> > > solar <solar@gentoo.org> wrote:
> > >
> > > > On Wed, 2006-03-15 at 10:51 +0100, Paul de Vrieze wrote:
> > > >
> > > > [snip]
> > > >
> > > > > Actually, C++ being strongly related to C, can just use the C
> > > > > python api's. As such it could directly interface with python, and
> > > > > use the python portage api.
> > > >
> > > > If you could demonstrate an 'import portage' and a simple
> > > > printf("PORTDIR=%s\n", PORTDIR); in C I'd be highly interested.
> > >
> > > Try attached :)  Had a go 'coz I was curious.  Compile with:
> > >
> > > gcc -o getportdir getportdir.c -lpython2.4
> > >
> > > Does the equivalent of:
> > >
> > > #!/usr/bin/portage
> > > import portage;
> > > print portage.settings["PORTDIR"];
> > >
> > > (more or less).  Docs on the API itself (which comes with Python) are at
> > > http://docs.python.org/api/api.html
> >
> > thanks Kevin,
> >  marienz also put 3 examples together to demonstrate it.
> >
> > /me feels like a kid in a candy store.
> >
> > thanks guys.
> >
> >
> > --
> > solar <solar@gentoo.org>
> > Gentoo Linux
> >
> > --
> > gentoo-portage-dev@gentoo.org mailing list
> >
> >
>
>
> --
> tvali
> (e-mail: "qtvali@gmail.com"; msn: "qtvali@gmail.com";
> icq: "317-492-912")
>
> Ühe eesti internetifirma lehel kohtasin tsitaati:
> If you don't do it excellently, dont do it at all. Because if it's not
> excellent, it won't be profitable or fun, and if you're not in
> business for fun or profit, what the hell are you doing here?
> Robert Townsend
>
>
>


--
tvali
(e-mail: "qtvali@gmail.com"; msn: "qtvali@gmail.com";
icq: "317-492-912")

Ühe eesti internetifirma lehel kohtasin tsitaati:
If you don't do it excellently, dont do it at all. Because if it's not
excellent, it won't be profitable or fun, and if you're not in
business for fun or profit, what the hell are you doing here?
Robert Townsend

-- 
gentoo-portage-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2006-03-15 22:16 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-13 22:39 [gentoo-portage-dev] Hello! && portage UI tvali
2006-03-14  0:54 ` Brian
2006-03-14 11:14   ` tvali
2006-03-14 14:39     ` Brian
2006-03-14 14:55       ` tvali
2006-03-14 15:07         ` Brian
2006-03-14 15:18       ` Marius Mauch
2006-03-14 16:48         ` tvali
2006-03-14 16:55           ` tvali
2006-03-15  9:51           ` Paul de Vrieze
2006-03-15 14:52             ` solar
2006-03-15 15:12               ` tvali
2006-03-15 16:36                 ` solar
2006-03-15 17:36                   ` tvali
2006-03-15 20:42               ` portage from C (was Re: [gentoo-portage-dev] Hello! && portage UI) Kevin F. Quinn (Gentoo)
2006-03-15 21:37                 ` solar
2006-03-15 22:12                   ` tvali
2006-03-15 22:14                     ` tvali

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox