Starting Python development

Contribute code to SolydXK and make it even better.
RemovedAccount_4

Re: Starting Python development

Postby RemovedAccount_4 » 14 May 2014 22:04

Update: Found this: http://stackoverflow.com/questions/2162 ... properties

Apparently the glade in the repos is not compatible with the gtk in the repos. :( I would need glade3 and not 'glade' but 'glade3' isn't in the repos. So I'd need to download it from here (3.8 and compile it myself).

I don't know if it will work but it sure seems like a lot of trouble to go through to get it to work.

RemovedAccount_4

Re: Starting Python development

Postby RemovedAccount_4 » 14 May 2014 22:16

Another Update: I can't compile the glade 3.8 because it needs two packages, one that is installed but isn't being detected and the other isn't even in the repos:

No package 'gtk+-2.0' found (installed but it's not being detected)
No package 'libxml-2.0' found (not found in the repos)

I can't find a way to get a working glade/phython setup. (Note: I'm working in SolydK - the latest UP) and in a VM so I don't mess up my production system).

User avatar
ScottQuier
Posts: 1779
Joined: 18 Jul 2013 15:55
Location: Newport News, VA

Re: Starting Python development

Postby ScottQuier » 14 May 2014 23:34

The version of glade in the repos is broken.

Here's what I've done to get 3.16.1 to compile (can't go any higher with the other packages we have .... or don't have)
  1. Look at this post --> http://forums.solydxk.nl/viewtopic.php?f=12&t=3604
  2. Install the first package list ... I believe you can ignore the second apt-get install if you like
  3. Download source from https://download.gnome.org/sources/glade/3.16/
  4. Copy to build location
  5. tar xf the tar file
  6. cd into the glade source folder
  7. ./configure
  8. dh_make --createorig
  9. DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage
  10. cd ..
You should see these files:

Code: Select all

drwxr-xr-x 14 scott scott    4096 May 14 19:22 glade-3.16.1
-rw-r--r--  1 scott scott    1480 May 14 19:24 glade_3.16.1-1_amd64.changes
-rw-r--r--  1 scott scott 2560658 May 14 19:24 glade_3.16.1-1_amd64.deb
-rw-r--r--  1 scott scott    8904 May 14 19:22 glade_3.16.1-1.debian.tar.xz
-rw-r--r--  1 scott scott     821 May 14 19:22 glade_3.16.1-1.dsc
-rw-r--r--  1 scott scott 2929480 May 14 19:18 glade_3.16.1.orig.tar.xz
Now, all you have to do is install the package .....

Code: Select all

sudo dpkg -i ./glade_3.16.1-1_amd64.deb
If you need any more help .... let me know

ETA: If you really want 3.8, you can/should download it from --> https://download.gnome.org/sources/glade/3.8/

After that, the compilation process is much the same.
Scott
Quoting zerozero, "The usage of PPA's in debian-based
systems is risky at best and entails serious compatibility
problems; usually it's the best way to destroy an install"

RemovedAccount_4

Re: Starting Python development

Postby RemovedAccount_4 » 15 May 2014 00:31

Thanks, Scott. I'm trying it now (doing the first apt-get install at the moment). I'm debating if I should go try 3.8 or if I should go with the one you mentioned first. I might try 3.8 first. After all, if I screw things up, I can just clone another dev VM and try again. That's how I set up my VMs. I have a basic one and then when I want to do development, I full-clone it and go from there. That way installing stuff, I don't have to start from scratch complete if I screw things up. Also I have my current clone on seamless, which is nice. :) Gotta love those VMs!

Getting off topic (sorry). But I'll let you know how I do with the install. I been wanting to try learning Linux devlopment for a long time now.

RemovedAccount_4

Re: Starting Python development

Postby RemovedAccount_4 » 15 May 2014 01:01

Got to the dh_make --createorig part and I used (s) for Single Binary. It also came up with my username in the fields. Hope that's ok? Also, I had to install these:

Code: Select all

sudo apt-get install intltool gtk+-2.0 dh-make
Going to try it with a tutorial now...

RemovedAccount_4

Re: Starting Python development

Postby RemovedAccount_4 » 15 May 2014 01:27

Ok, looks like 3.8 is working (didn't try the 3.1x).

However, this tutorial: http://www.micahcarrick.com/gtk-glade-t ... art-1.html
That one the menu part of it (which is as far as I could get) is not at all what you see in the actual glade interface so one can't follow that tutorial at all.

This tutorial: http://gnipsel.com/glade/glade01b.html
I got through part 1 ok and this time it run just fine. So this is the tutorial I guess I'll be following. It's also a much newer tutorial.

Thanks, Scott, for saving me again. :)

RemovedAccount_4

Re: Starting Python development

Postby RemovedAccount_4 » 15 May 2014 02:01

Well the tutorial here: http://gnipsel.com/glade/glade01b.html is ok but it has a ton of mistakes. Like what to name the file (it goes between gladex.* and tutoral-x.* in the same tutorial). Also it has you make a scrolling area and text view at first and mentioned you'll be making a text editor. Then by the time you get to part 4, it says to remove the "label" from the center. You never put one there - the center was the scrolling area and text view. I didn't get past part 4 yet (I skimmed it but didn't do that part yet).

But, this is about the closest and most current Python/Glade3 tutorial out there that actually works (for the most part, so far).

User avatar
Arjen Balfoort
Site Admin
Posts: 8697
Joined: 26 Jan 2013 19:36
Location: Netherlands
Contact:

Re: Starting Python development

Postby Arjen Balfoort » 15 May 2014 06:37

I haven't read all the posts, but maybe this helps.
This is (partly) what I install for development:

Code: Select all

sudo apt-get install ninja-ide python python3 python-gtk2 gir1.2-gtk-3.0 python-glade2 kiki python-stdeb python-pyip bzr git gitg gitk git-cola libgladeui-1-9 kompare libgtk2.0-dev poedit glade


SolydXK needs you!
Development | Testing | Translations

RemovedAccount_4

Re: Starting Python development

Postby RemovedAccount_4 » 15 May 2014 09:45

Thanks, schoelje. I got it working thanks to Scott. However, I'll double-check to be sure I got all the packages.

As for the 'glade' package in the repos, Scott mentioned it's broken. I think that's going to need fixing. I was able to successfully compile the latest glade 3.8 and that is working out just fine. The tutorial I been following isn't the greatest but it's the most recent and works for the most part. I'm getting a good idea how it all works. :)

I have made the .deb of glade 3.8 as per Scott's instructions and successfully installed it. So I know the .deb can be made. But not sure if that would qualify for putting it in the repos?

User avatar
ScottQuier
Posts: 1779
Joined: 18 Jul 2013 15:55
Location: Newport News, VA

Re: Starting Python development

Postby ScottQuier » 15 May 2014 21:02

Glade 3.8 is old. This is what is in the repos

Code: Select all

glade:
  Installed: (none)
  Candidate: 3.14.2-3
  Version table:
     3.14.2-3 0
        500 http://debian.solydxk.com/production/ testing/main amd64 Packages
Ver 3.8 is good for Gtk+ 2.7

You want to use Glade 3.16 if you want to work with Gtk+ 3 .... which is why I indicated the 3.16 folder in my post.
Scott
Quoting zerozero, "The usage of PPA's in debian-based
systems is risky at best and entails serious compatibility
problems; usually it's the best way to destroy an install"

RemovedAccount_4

Re: Starting Python development

Postby RemovedAccount_4 » 15 May 2014 22:07

I'm getting old. I thought 3.8 was newer than 3.16 because I saw the 3.1 and didn't think about what came after the 1 or what number that actually made. :oops: :roll: :lol:

I gotta go change the notes I saved for myself and go do another install. Thanks for pointing it out to me!

User avatar
ScottQuier
Posts: 1779
Joined: 18 Jul 2013 15:55
Location: Newport News, VA

Re: Starting Python development

Postby ScottQuier » 15 May 2014 22:48

What's really nice is the 3.8 and 3.16 can live together on the same machine just fine. This is nice when you encounter a project that was done in Gtk+ 2.7 - then just load the .glade file into glade 3.8. Works a real treat!
Scott
Quoting zerozero, "The usage of PPA's in debian-based
systems is risky at best and entails serious compatibility
problems; usually it's the best way to destroy an install"

RemovedAccount_4

Re: Starting Python development

Postby RemovedAccount_4 » 15 May 2014 22:55

So you'd advise I keep both on the system? I was going to put only one and get rid of the 3.8 deb but I'll keep it now. I just deleted that VM anyway as I'm going to test your suggestions and also give Schoelje's instructions a test as well. Right now though it looks like both my base SolydX and SolydK dev VMs both need updating and backing up so I'm doing that first. All that takes time so I don't know if I'll get to the actual installs of glade tonight or not. If not then tomorrow. I'm trying to dedicate my evenings to learning Python/Glade (after working on php code for work during the day). I'm a chronic coder. :lol: Maybe I need to make that a T-Shirt!

User avatar
ScottQuier
Posts: 1779
Joined: 18 Jul 2013 15:55
Location: Newport News, VA

Re: Starting Python development

Postby ScottQuier » 15 May 2014 23:07

As long as you put that slogan inside HTML or XML tags!

Oh, and yes. Keep both.
Scott
Quoting zerozero, "The usage of PPA's in debian-based
systems is risky at best and entails serious compatibility
problems; usually it's the best way to destroy an install"

RemovedAccount_4

Re: Starting Python development

Postby RemovedAccount_4 » 16 May 2014 01:13

You mean like:

Code: Select all

<chronic_coder>[picture of hacker asleep at the keyboard]</chronic_coder>
I'm almost done with my backups... Hopefully I can clone a couple dev VMs tonight but not sure if I'll be compiling 3.16 tonight or not.

RemovedAccount_4

Re: Starting Python development

Postby RemovedAccount_4 » 16 May 2014 04:20

@Schoelje: I'll have to figure out the whole installation thing. I tried your suggestion and there is no more 'libgladeui-1-9' in the repos. So you need to replace that with 'libgladeui-common'. Then it works. I have to learn how to use ninja one of these days. Looks complicated but then again that is what I said about Eclipse and I use Eclipse all the time (love it!).

@Scott: The 3.16 had signing errors so to fix that I used:

Code: Select all

DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -us -uc
Anyway, I got debs made, and in a VM I have both 3.8 and 3.16 installed.

BTW, I have two separate VMs right now: One with Scheolje's suggested install and one with Scott's suggested install. It's late so I can't play around with them right now. Suffice to say the tutorials are as mentioned: one very old and not accurate and the other has it's problems. But overally all glade versions do work. I'm going to try and create an universal installation instructions set or script. Once I got something pretty well fixed up, and maybe a tutorial, I'll post it on my web site (giving credit to Schoelje and Scott of course for help in these). It'll be a combination of all those instructions plus things I found out about during my trials. Hopefully this may help folks get started with Python/Glade. I'll provide a link here when I get that done.

User avatar
Arjen Balfoort
Site Admin
Posts: 8697
Joined: 26 Jan 2013 19:36
Location: Netherlands
Contact:

Re: Starting Python development

Postby Arjen Balfoort » 16 May 2014 07:11

Any suggestions to update the OP are very welcome ;)
I'll be off for a few days, but I'll try to answer my mail, and PM's.


SolydXK needs you!
Development | Testing | Translations

RemovedAccount_4

Re: Starting Python development

Postby RemovedAccount_4 » 16 May 2014 13:27

I think for your OP, the instructions you made for me are good. Just replace 'libgladeui-1-9' with 'libgladeui-common' in your apt-get line and it will work. As for tutorials, the only one that even comes close (and even then there are mistakes and you'll have to find work-arounds) is this one: http://gnipsel.com/glade/glade01b.html

This Python tutorial I haven't tried but it's one (was it you or someone else - sorry I forgot) suggested: http://learnpythonthehardway.org/book/

My tutorials may take a bit to create but I'll evenutally get there.

User avatar
ScottQuier
Posts: 1779
Joined: 18 Jul 2013 15:55
Location: Newport News, VA

Re: Starting Python development

Postby ScottQuier » 16 May 2014 20:36

I second the vote on this tutorial for inclusing in the OP --> http://gnipsel.com/glade/

This link is the "index" page for the multi-part tutorial.

And, RavenLX is right - there are some errors and inconsistancies in the tut ... but it's the best I've found so far.

Oh, BTW ... I'm still working my way through this one.
Scott
Quoting zerozero, "The usage of PPA's in debian-based
systems is risky at best and entails serious compatibility
problems; usually it's the best way to destroy an install"

User avatar
Arjen Balfoort
Site Admin
Posts: 8697
Joined: 26 Jan 2013 19:36
Location: Netherlands
Contact:

Re: Starting Python development

Postby Arjen Balfoort » 17 May 2014 10:27

Great!
I've updated the OP.


SolydXK needs you!
Development | Testing | Translations


Return to “Code”

Who is online

Users browsing this forum: No registered users and 1 guest