Kruptein 15 Posting Whiz in Training

Why can't I use tabs ? I hate it when I every time have to hit 4 times the tab.
Btw every program I made till now works with those tabs.

Kruptein 15 Posting Whiz in Training

If I run the following code the textCtrl's aren't updated, they stay empty, but if I do print self.extra201.GetValue() I get the value that is set with the code beneath.

self.extra101.SetValue(names[1])
self.extra201.SetValue(names[2])
self.extra111.SetValue(str(money[1]))
self.extra211.SetValue(str(money[2]))

Why isn't it update !! :(

Kruptein 15 Posting Whiz in Training

I just need to know how the pygtk progressbar works, on the internet I can't find any good info about it ...

Kruptein 15 Posting Whiz in Training

What am I doing wrong?

for filename in /home/darragh/public_html/test/*
do
 sed -i 's/..\/config/.\/config/g'
done;

It just gives me: sed: No input files

Kruptein 15 Posting Whiz in Training

Can someone help me with this, if I run ftp, the page is downloaded and showed well, but the progress bar only shows 100% and doesn't progress at all..

def progress_timeout(pbobj):
	        # Calculate the value of the progress bar using the
       		# value range set in the adjustment object
       		new_val = pbobj.pbar.get_fraction() + 0.01
       		if new_val > 1.0:
       			new_val = 0.0
		        # Set the new value
		        pbobj.pbar.set_fraction(new_val)

	    	# As this is a timeout function, return TRUE so that it
		# continues to get called
		return True


	def ftp(self, w, date):
        	self.win = gtk.Window(gtk.WINDOW_POPUP)
	        self.win.set_resizable(True)
	        self.win.set_title("ProgressBar")
	        self.win.set_border_width(0)
	        fvbox = gtk.VBox(False, 5)
	        fvbox.set_border_width(10)
	        self.win.add(fvbox)
	        fvbox.show()
	        # Create a centering alignment object
        	align = gtk.Alignment(0.5, 0.5, 0, 0)
        	fvbox.pack_start(align, False, False, 5)
	        align.show()
        	# Create the ProgressBar
        	self.pbar = gtk.ProgressBar()
        	align.add(self.pbar)
        	self.pbar.show()
        	# Add a timer callback to update the value of the progress bar
        	self.timer = gobject.timeout_add (100, self.progress_timeout, self)
	        self.win.show()
		self.progress_timeout
		ftp = FTP(self.host)
		percent = 0.1
 		self.pbar.set_text("10%")
                self.pbar.set_fraction(percent)
		self.progress_timeout
		ftp.login(self.usr,self.pswd)
		percent = 0.2
               	self.pbar.set_text("20%")
                self.pbar.set_fraction(percent)
		self.progress_timeout
		ftp.cwd(self.dir)
		percent = 0.3
               	self.pbar.set_text("30%")
                self.pbar.set_fraction(percent)
		self.progress_timeout
		retr = 'RETR ' + self.ftpfile
		ftpp = self.location + '/ftp.ded'
		ftp.retrbinary(retr, open(ftpp, 'w').write)
		percent = 0.4
               	self.pbar.set_text("40%")
                self.pbar.set_fraction(percent)
		self.progress_timeout
		ftp.quit()
		percent = 0.5
               	self.pbar.set_text("50%")
                self.pbar.set_fraction(percent)
		self.progress_timeout
		txt = ''
		f = open(ftpp, 'r')
		percent = 0.6
               	self.pbar.set_text("60%")
                self.pbar.set_fraction(percent)
		self.progress_timeout
		for line in f.readlines():
			txt = txt + line
			self.textbuffer.set_text(txt)
		f.close()
		percent = 0.9
               	self.pbar.set_text("90%")
                self.pbar.set_fraction(percent)
		self.progress_timeout
		self.cmdbuf.set_text('Opened: ftp.ded')
		percent = 1.0
               	self.pbar.set_text("100%")
                self.pbar.set_fraction(percent)
		self.progress_timeout
		self.opnd = 'ftp.ded'