Author Topic: Lets create a PCLinuxOS webkit browser (python)  (Read 28473 times)

Offline Hootiegibbon

  • Hero Member
  • *****
  • Posts: 4151
Lets create a PCLinuxOS webkit browser (python)
« on: March 27, 2011, 03:52:22 PM »


Let me start by sayiing I am not a coder, I am a hacker, I tend to find something and hack away until I get  close to what I want or need  so you may be aware I am always on the look out for somthing leaner, meaner but useful so I found the following code online
Code: [Select]
#!/usr/bin/env python
import gtk
import webkit
import gobject

gobject.threads_init()
win = gtk.Window()
bro = webkit.WebView()
bro.open("http://www.google.com")
win.add(bro)
win.show_all()
gtk.main()


This code when saved a s python script launches a basic browser that opens the bro.open address - I changed mine for the forums here.

Now the proposition how to get this to be more than a page viewer? and perhaps get a fast simple light PCLinuxOS branded browser ?

Thoughts?

Jase


I am Hootiegibbon, undisputed champion fo the typo

My .dotfiles

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Lets create a PCLinuxOS webkit browser (python)
« Reply #1 on: March 27, 2011, 04:18:10 PM »
Been thinking on this lately, too. I'm not a python coder, but I dabble a little bit. I'll hack away at it until someone who knows python comes along.

Online scoundrel

  • Administrator
  • Hero Member
  • *****
  • Posts: 4540
  • Philosophy= Bigger Hammer
Re: Lets create a PCLinuxOS webkit browser (python)
« Reply #2 on: March 27, 2011, 04:29:15 PM »
well guys .. not a brainiac like you two, but a bigger hammer kinda fellow .. let us know if'n you need it beat to submission  ;D
Please Donate Today..Or I Will Make You Wish You Had

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Lets create a PCLinuxOS webkit browser (python)
« Reply #3 on: March 27, 2011, 04:34:38 PM »
As Jase posted it, it can be used to navigate the web, albeit through google search.

Offline AndrzejL

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 12802
  • RLU #490933
    • Wordpress On The Wardrobe...
Re: Lets create a PCLinuxOS webkit browser (python)
« Reply #4 on: March 27, 2011, 04:57:49 PM »
The only thing I can say is GO ON Dudes... coz I can't code for sh...ell script ;)

There must be as snake charmer around that will be able to work with Python.

Andy

Offline Hootiegibbon

  • Hero Member
  • *****
  • Posts: 4151
Re: Lets create a PCLinuxOS webkit browser (python)
« Reply #5 on: March 27, 2011, 04:59:55 PM »
As a further idea I wonder if it could be made modular?

So that the base would be sparse (like above but with an address bar with basic navigation buttons)

with other add on scripts to add link hinting, cookie handling, history, bookmarks (with a use dropbox to sync feature?)

with a 'task-pclosbrowser' for a full featured version, or add what you need...

I am not sure how ambitious i am with that idea though

I am drawing inspiration from luakit I think

Jase
« Last Edit: March 27, 2011, 05:04:42 PM by Hootiegibbon »


I am Hootiegibbon, undisputed champion fo the typo

My .dotfiles

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Lets create a PCLinuxOS webkit browser (python)
« Reply #6 on: March 27, 2011, 05:08:12 PM »
I was thinking of having different scripts for different functions and to have the main script to call those scripts for the activation of those functions. For example, create an address entry field and have it called as bro.open("http://www.google.com") is called in the present script; i.e. call bro.open("address entry script"). (only an example, guys)

In this way, only those scripts that were in use would be loaded with the main script.

Offline Hootiegibbon

  • Hero Member
  • *****
  • Posts: 4151
Re: Lets create a PCLinuxOS webkit browser (python)
« Reply #7 on: March 27, 2011, 05:35:22 PM »
I was thinking of having different scripts for different functions and to have the main script to call those scripts for the activation of those functions. For example, create an address entry field and have it called as bro.open("http://www.google.com") is called in the present script; i.e. call bro.open("address entry script"). (only an example, guys)

In this way, only those scripts that were in use would be loaded with the main script.



YES!! thats a better idea

So its minimal when you need it minimal but if you need a function - it loads it in.

btw - this already plays the  music videos on the music thread  :)

It would also be good to be able to control some of the webkit functions via an address bar ie :set

another possibility is whether to have native tabs or to use 'tabbed' as produced by the 'suckless' community

Jase


I am Hootiegibbon, undisputed champion fo the typo

My .dotfiles

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Lets create a PCLinuxOS webkit browser (python)
« Reply #8 on: March 27, 2011, 05:59:12 PM »
Yes, I tested youtube. The videos play fine. I'm trying to figure out how to do the address field. We may need back and forward buttons, too.

My ability with python is not great, so anyone who wants to join in, please do.



Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Lets create a PCLinuxOS webkit browser (python)
« Reply #9 on: March 28, 2011, 03:16:19 AM »
Progress so far on creating a URL entry field:
Code: [Select]
#!/usr/bin/env python
#Lets call this urly.py
import os
import string
import sys
from Tkinter import *

root = Tk()
master = Frame(root)
master.pack()

e = Entry(master)
e.pack()
e.focus_set()

answer = ""

def setanswer():
  global answer
  answer = e.get()

# Set up a URL display/entry area.
def create_urlbar(self):
        f = Frame(self.topframe)
        f.pack(fill=X)
        l = Label(self.root, name="uriLabel")
        l.pack(side=LEFT, in_=f)
        self.entry = Entry(self.root, name="uriEntry")
        self.entry.pack(side=LEFT, fill=X, expand=1, in_=f)
        self.entry.bind('<Return>', self.load_from_entry)

root.mainloop()

This will need more work. There is nothing at this time being called for the creation of the address bar. :-\ Please have a look at it, and see what you think. Suggestions welcome.

Edit: changed some of the code. A url entry field is created now. Next importing it into the browser code.
« Last Edit: March 28, 2011, 03:48:29 AM by Neal »

Offline slax

  • Sr. Member
  • ****
  • Posts: 391
    • PCLinuxOS Gnome Edition
Re: Lets create a PCLinuxOS webkit browser (python)
« Reply #10 on: March 28, 2011, 01:27:00 PM »
I don't want to be a party crasher :D, but i see no point in this when there are huge number of browsers...

There are a lot of stuff on pclos that needs improving we should focus on...

just my 2c, don't hate me for it ;)



Offline Hootiegibbon

  • Hero Member
  • *****
  • Posts: 4151
Re: Lets create a PCLinuxOS webkit browser (python)
« Reply #11 on: March 28, 2011, 01:32:19 PM »
I don't want to be a party crasher :D, but i see no point in this when there are huge number of browsers...

There are a lot of stuff on pclos that needs improving we should focus on...

just my 2c, don't hate me for it ;)

Slax,

As with all things in life, if there is something optional you don't like to do, don't do it, but don't try to stop others who do want to.

For the stuff you feel needs focus, have a go....

No need for a responce

Jase


I am Hootiegibbon, undisputed champion fo the typo

My .dotfiles

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Lets create a PCLinuxOS webkit browser (python)
« Reply #12 on: March 28, 2011, 01:44:09 PM »
slax,
Does it really matter how many of any app exist? Creating a web browser that is specifically designed for PCLinuxOS is a worthy project, IMO.

Work on whatever project you choose.

Offline slax

  • Sr. Member
  • ****
  • Posts: 391
    • PCLinuxOS Gnome Edition
Re: Lets create a PCLinuxOS webkit browser (python)
« Reply #13 on: March 28, 2011, 02:02:26 PM »
Ok, sorry for my response, i didn't meant to offend anyone



Offline Texstar

  • Administrator
  • Super Villain
  • *****
  • Posts: 12536
Re: Lets create a PCLinuxOS webkit browser (python)
« Reply #14 on: March 28, 2011, 02:07:41 PM »
Ok, sorry for my response, i didn't meant to offend anyone

I don't think anybody was offended. People were just posting their opinions on the subject.

Thanks to everyone who donates. You keep the servers running.