<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://techbase.kde.org/skins/common/feed.css?0.2"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://techbase.kde.org/index.php?title=Development/Languages/Python/PyKDE_Knotify_Tutorial/MyJob.py&amp;feed=atom&amp;action=history</id>
		<title>Development/Languages/Python/PyKDE Knotify Tutorial/MyJob.py - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://techbase.kde.org/index.php?title=Development/Languages/Python/PyKDE_Knotify_Tutorial/MyJob.py&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/index.php?title=Development/Languages/Python/PyKDE_Knotify_Tutorial/MyJob.py&amp;action=history"/>
		<updated>2013-05-19T04:46:07Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.20.2</generator>

	<entry>
		<id>http://techbase.kde.org/index.php?title=Development/Languages/Python/PyKDE_Knotify_Tutorial/MyJob.py&amp;diff=65469&amp;oldid=prev</id>
		<title>Macdems: Added the line setting job description</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/index.php?title=Development/Languages/Python/PyKDE_Knotify_Tutorial/MyJob.py&amp;diff=65469&amp;oldid=prev"/>
				<updated>2011-09-04T13:06:49Z</updated>
		
		<summary type="html">&lt;p&gt;Added the line setting job description&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 13:06, 4 September 2011&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 45:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 45:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; #-&amp;gt; show this to everybody&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; #-&amp;gt; show this to everybody&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; KJob.setPercent(self,self.i*4)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; KJob.setPercent(self,self.i*4)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; self.description.emit(self, &amp;quot;Our Splendid Job&amp;quot;, (&amp;quot;Source&amp;quot;,&amp;quot;counter&amp;quot;), (&amp;quot;Destination&amp;quot;,&amp;quot;dummy&amp;quot;))&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; if self.i==self.max:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; if self.i==self.max:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Macdems</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/index.php?title=Development/Languages/Python/PyKDE_Knotify_Tutorial/MyJob.py&amp;diff=60458&amp;oldid=prev</id>
		<title>Neverendingo: Text replace - &quot;&lt;/code&gt;&quot; to &quot;&lt;/syntaxhighlight&gt;&quot;</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/index.php?title=Development/Languages/Python/PyKDE_Knotify_Tutorial/MyJob.py&amp;diff=60458&amp;oldid=prev"/>
				<updated>2011-06-29T20:49:59Z</updated>
		
		<summary type="html">&lt;p&gt;Text replace - &amp;quot;&amp;lt;/code&amp;gt;&amp;quot; to &amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&amp;quot;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 20:49, 29 June 2011&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 117:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 117:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; #wait till all is done&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; #wait till all is done&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; app.exec_()&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; app.exec_()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;code&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;syntaxhighlight&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Neverendingo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/index.php?title=Development/Languages/Python/PyKDE_Knotify_Tutorial/MyJob.py&amp;diff=59823&amp;oldid=prev</id>
		<title>Neverendingo: Text replace - &quot;&lt;code python&gt;&quot; to &quot;&lt;syntaxhighlight lang=&quot;python&quot;&gt;&quot;</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/index.php?title=Development/Languages/Python/PyKDE_Knotify_Tutorial/MyJob.py&amp;diff=59823&amp;oldid=prev"/>
				<updated>2011-06-29T20:33:51Z</updated>
		
		<summary type="html">&lt;p&gt;Text replace - &amp;quot;&amp;lt;code python&amp;gt;&amp;quot; to &amp;quot;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&amp;quot;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 20:33, 29 June 2011&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;code &lt;/del&gt;python&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;syntaxhighlight lang=&amp;quot;&lt;/ins&gt;python&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot;&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#! /usr/bin/python&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#! /usr/bin/python&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# -*- coding: utf-8 -*-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# -*- coding: utf-8 -*-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Neverendingo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/index.php?title=Development/Languages/Python/PyKDE_Knotify_Tutorial/MyJob.py&amp;diff=53312&amp;oldid=prev</id>
		<title>Hefee: Terimation</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/index.php?title=Development/Languages/Python/PyKDE_Knotify_Tutorial/MyJob.py&amp;diff=53312&amp;oldid=prev"/>
				<updated>2010-08-10T00:12:01Z</updated>
		
		<summary type="html">&lt;p&gt;Terimation&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 00:12, 10 August 2010&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;code python&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;code python&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#! /usr/bin/python&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#! /usr/bin/python&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 79:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 78:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; else:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; else:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160;  print 'job has terminated successfully'&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160;  print 'job has terminated successfully'&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; #termination the whole application&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; sys.exit()&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;if __name__ == &amp;quot;__main__&amp;quot;:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;if __name__ == &amp;quot;__main__&amp;quot;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 113:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 115:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; job.start()&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; job.start()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; #wait till all is done&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; app.exec_()&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Hefee</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/index.php?title=Development/Languages/Python/PyKDE_Knotify_Tutorial/MyJob.py&amp;diff=53307&amp;oldid=prev</id>
		<title>Hefee: Version 1.0</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/index.php?title=Development/Languages/Python/PyKDE_Knotify_Tutorial/MyJob.py&amp;diff=53307&amp;oldid=prev"/>
				<updated>2010-08-09T23:56:13Z</updated>
		
		<summary type="html">&lt;p&gt;Version 1.0&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
&amp;lt;code python&amp;gt;&lt;br /&gt;
#! /usr/bin/python&lt;br /&gt;
# -*- coding: utf-8 -*-&lt;br /&gt;
from PyQt4.QtCore import QObject,QTimer,QString&lt;br /&gt;
from PyKDE4.kdecore import KJob&lt;br /&gt;
from PyKDE4.kio import KIO&lt;br /&gt;
 &lt;br /&gt;
class MyJob(KJob):&lt;br /&gt;
    def __init__(self,parent=QObject()):&lt;br /&gt;
        KJob.__init__(self,parent)&lt;br /&gt;
        #We want to have a Suspenable and Killable Job&lt;br /&gt;
        self.setCapabilities(KJob.Capabilities(KJob.Suspendable|KJob.Killable))&lt;br /&gt;
 &lt;br /&gt;
        #Just a maximum Variable&lt;br /&gt;
        self.max=25&lt;br /&gt;
 &lt;br /&gt;
        #index&lt;br /&gt;
        self.i=0&lt;br /&gt;
 &lt;br /&gt;
    def start(self):&lt;br /&gt;
        #register the Job to the JobTracker&lt;br /&gt;
        KIO.getJobTracker().registerJob(self)&lt;br /&gt;
&lt;br /&gt;
        #initalizing for work&lt;br /&gt;
        self.i=0&lt;br /&gt;
 &lt;br /&gt;
        #start the actual work in another thread&lt;br /&gt;
        #this function has to terminate, before the work is done&lt;br /&gt;
        QTimer().singleShot(0, self.doWork)&lt;br /&gt;
 &lt;br /&gt;
    def doWork(self):             &lt;br /&gt;
        #the actual work                                         &lt;br /&gt;
        try:            &lt;br /&gt;
            #if we are killed or suspended just return                                           &lt;br /&gt;
            if self.error() or self.isSuspended():                    &lt;br /&gt;
                return&lt;br /&gt;
        except RuntimeError:&lt;br /&gt;
            #if this class is killed before a RuntimeError will raise&lt;br /&gt;
            return&lt;br /&gt;
 &lt;br /&gt;
        #do a peace of hard work&lt;br /&gt;
        self.i+=1&lt;br /&gt;
 &lt;br /&gt;
        #fortunately we have made a peace of work &lt;br /&gt;
        #-&amp;gt; show this to everybody&lt;br /&gt;
        KJob.setPercent(self,self.i*4)&lt;br /&gt;
 &lt;br /&gt;
        if self.i==self.max:&lt;br /&gt;
            #jeah we have done the bunch of work&lt;br /&gt;
            #send the result signal for showing, that we ended the work&lt;br /&gt;
            self.emitResult()&lt;br /&gt;
            return &lt;br /&gt;
        #just go to sleep for 1000ms than go on&lt;br /&gt;
        QTimer().singleShot(1000, self.doWork)&lt;br /&gt;
 &lt;br /&gt;
    def doSuspend(self):&lt;br /&gt;
        #the surounding function from KJob makes the isSuspended() become True&lt;br /&gt;
        #returns True for signaling that this class supports to suspend&lt;br /&gt;
        return True&lt;br /&gt;
 &lt;br /&gt;
    def doResume(self):&lt;br /&gt;
        #start with work again&lt;br /&gt;
        QTimer().singleShot( 0, self.doWork )&lt;br /&gt;
        #return True for signaling that this class supports resuming&lt;br /&gt;
        return True&lt;br /&gt;
 &lt;br /&gt;
    def doKill(self):&lt;br /&gt;
        #return True for signaling that we support killing&lt;br /&gt;
        return True&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def handleResult(job):&lt;br /&gt;
    #handleResult Function&lt;br /&gt;
    #it is called when the job is terminating&lt;br /&gt;
    if job.error():&lt;br /&gt;
       print 'error happend'&lt;br /&gt;
    else:&lt;br /&gt;
       print 'job has terminated successfully'&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    import sys&lt;br /&gt;
 &lt;br /&gt;
    from PyKDE4.kdecore import KCmdLineArgs, KAboutData, KLocalizedString, ki18n&lt;br /&gt;
    from PyKDE4.kdeui import KApplication    &lt;br /&gt;
 &lt;br /&gt;
    appName     = &amp;quot;default&amp;quot;&lt;br /&gt;
    catalog     = &amp;quot;&amp;quot;&lt;br /&gt;
    programName = ki18n (&amp;quot;default&amp;quot;)  &lt;br /&gt;
    version     = &amp;quot;1.0&amp;quot;&lt;br /&gt;
    description = ki18n (&amp;quot;Default Example&amp;quot;)  &lt;br /&gt;
    license     = KAboutData.License_GPL&lt;br /&gt;
    copyright   = ki18n (&amp;quot;(c) 2010 Sandro Knauß&amp;quot;) &lt;br /&gt;
    text        = ki18n (&amp;quot;none&amp;quot;) &lt;br /&gt;
    homePage    = &amp;quot;techbase.kde.org&amp;quot;&lt;br /&gt;
    bugEmail    = &amp;quot;bugs@sandroknauss.de&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
    aboutData   = KAboutData (appName, catalog, programName, version, description,&lt;br /&gt;
                              license, copyright, text, homePage, bugEmail)&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
    KCmdLineArgs.init (sys.argv, aboutData)&lt;br /&gt;
 &lt;br /&gt;
    app = KApplication ()&lt;br /&gt;
    &lt;br /&gt;
    #create job&lt;br /&gt;
    job=MyJob(app)&lt;br /&gt;
&lt;br /&gt;
    job.result.connect(handleResult)&lt;br /&gt;
&lt;br /&gt;
    #start job&lt;br /&gt;
    job.start()&lt;br /&gt;
    &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hefee</name></author>	</entry>

	</feed>