http://codingteam.net/atom/pasteNotepadLatest pastes in the notepad.2013-06-16T18:47:06+02:00SubCategories Magento2013-06-16T16:13:14+02:00http://codingteam.net/paste/show/784leoswhttp://codingteam.net/users/show/leosw<pre class="php" style="font-family:monospace;"><ol><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><div id="categories"></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #000088;">$_maincategorylisting</span><span style="color: #339933;">=</span><span style="color: #000088;">$this</span><span style="color: #339933;">-></span><span style="color: #004000;">getCurrentCategory</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #000000; font-weight: bold;">?></span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #000088;">$_categories</span><span style="color: #339933;">=</span><span style="color: #000088;">$this</span><span style="color: #339933;">-></span><span style="color: #004000;">getCurrentChildCategories</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #000000; font-weight: bold;">?></span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">(</span><span style="color: #000088;">$_categories</span><span style="color: #339933;">-></span><span style="color: #004000;">count</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #009900;">)</span><span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">?></span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000000; font-weight: bold;"><?</span> <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">(</span><span style="color: #000088;">$_categories</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$_category</span><span style="color: #009900;">)</span><span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">?></span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000000; font-weight: bold;"><?</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">(</span><span style="color: #000088;">$_category</span><span style="color: #339933;">-></span><span style="color: #004000;">getIsActive</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #009900;">)</span><span style="color: #339933;">:</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000088;">$cur_category</span><span style="color: #339933;">=</span>Mage<span style="color: #339933;">::</span><span style="color: #004000;">getModel</span><span style="color: #009900;">(</span><span style="color: #0000ff;">'catalog/category'</span><span style="color: #009900;">)</span><span style="color: #339933;">-></span><span style="color: #004000;">load</span><span style="color: #009900;">(</span><span style="color: #000088;">$_category</span><span style="color: #339933;">-></span><span style="color: #004000;">getId</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000088;">$layer</span> <span style="color: #339933;">=</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">getSingleton</span><span style="color: #009900;">(</span><span style="color: #0000ff;">'catalog/layer'</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000088;">$layer</span><span style="color: #339933;">-></span><span style="color: #004000;">setCurrentCategory</span><span style="color: #009900;">(</span><span style="color: #000088;">$cur_category</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000088;">$catName</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-></span><span style="color: #004000;">getCurrentCategory</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #339933;">-></span><span style="color: #004000;">getName</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000088;">$catDescription</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-></span><span style="color: #004000;">getCurrentCategory</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #339933;">-></span><span style="color: #004000;">getDescription</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #b1b100;">if</span><span style="color: #009900;">(</span><span style="color: #000088;">$_imageUrl</span><span style="color: #339933;">=!</span><span style="color: #000088;">$this</span><span style="color: #339933;">-></span><span style="color: #004000;">getCurrentCategory</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #339933;">-></span><span style="color: #004000;">getImageUrl</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #009900;">)</span><span style="color: #339933;">:</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000000; font-weight: bold;">?></span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #666666; font-style: italic;">/* Default subcategory jpg if no image exists */</span> <span style="color: #000000; font-weight: bold;">?></span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <div class="category-box"></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <div class="category-image-box"></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <a href="<span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-></span><span style="color: #004000;">getCategoryUrl</span><span style="color: #009900;">(</span><span style="color: #000088;">$_category</span><span style="color: #009900;">)</span><span style="color: #000000; font-weight: bold;">?></span>"><img src="<span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-></span><span style="color: #004000;">getSkinUrl</span><span style="color: #009900;">(</span><span style="color: #0000ff;">'images/subcategory-default.jpg'</span><span style="color: #009900;">)</span> <span style="color: #000000; font-weight: bold;">?></span>"></a> </div></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <div></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <p class="subcatname"><a href="<span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-></span><span style="color: #004000;">getCategoryUrl</span><span style="color: #009900;">(</span><span style="color: #000088;">$_category</span><span style="color: #009900;">)</span><span style="color: #000000; font-weight: bold;">?></span>"> <span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$catName</span> <span style="color: #000000; font-weight: bold;">?></span></a></p></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">(</span><span style="color: #000088;">$catDescription</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">""</span><span style="color: #009900;">)</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?></span><p class="subcatdesc"><span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$catDescription</span> <span style="color: #000000; font-weight: bold;">?></span></p><span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?></span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000000; font-weight: bold;"><?</span> <span style="color: #b1b100;">endif</span> <span style="color: #000000; font-weight: bold;">?></span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000000; font-weight: bold;"><?</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">(</span><span style="color: #000088;">$_imageUrl</span><span style="color: #339933;">=</span><span style="color: #000088;">$this</span><span style="color: #339933;">-></span><span style="color: #004000;">getCurrentCategory</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #339933;">-></span><span style="color: #004000;">getImageUrl</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #009900;">)</span><span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">?></span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #666666; font-style: italic;">/* Displays the subcategory image */</span> <span style="color: #000000; font-weight: bold;">?></span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <div class="category-box"></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <div class="category-image-box"></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <a href="<span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-></span><span style="color: #004000;">getCategoryUrl</span><span style="color: #009900;">(</span><span style="color: #000088;">$_category</span><span style="color: #009900;">)</span><span style="color: #000000; font-weight: bold;">?></span>"><img src="<span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$_imageUrl</span><span style="color: #000000; font-weight: bold;">?></span>" height="80"></a></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <div></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <p class="subcatname"><a href="<span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-></span><span style="color: #004000;">getCategoryUrl</span><span style="color: #009900;">(</span><span style="color: #000088;">$_category</span><span style="color: #009900;">)</span><span style="color: #000000; font-weight: bold;">?></span>"> <span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$catName</span> <span style="color: #000000; font-weight: bold;">?></span></a></p></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">(</span><span style="color: #000088;">$catDescription</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">""</span><span style="color: #009900;">)</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?></span><p class="subcatdesc"><span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$catDescription</span> <span style="color: #000000; font-weight: bold;">?></span></p><span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?></span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000000; font-weight: bold;"><?</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?></span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000000; font-weight: bold;"><?</span> <span style="color: #b1b100;">endforeach</span> <span style="color: #000000; font-weight: bold;">?></span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #000088;">$layer</span><span style="color: #339933;">-></span><span style="color: #004000;">setCurrentCategory</span><span style="color: #009900;">(</span><span style="color: #000088;">$_maincategorylisting</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?></span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000000; font-weight: bold;"><?</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?></span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"></div></div></li></ol></pre>diff2013-05-14T18:36:35+02:00http://codingteam.net/paste/show/782Pacohttp://codingteam.net/users/show/Paco<pre class="python" style="font-family:monospace;"><ol><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">dict1 = <span style="color: black;">{</span><span style="color: #ff4500;">1</span>: <span style="color: black;">[</span><span style="color: #ff4500;">1</span>, <span style="color: #ff4500;">2</span><span style="color: black;">]</span>,</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: black;">(</span><span style="color: #ff4500;">1</span>, <span style="color: #ff4500;">2</span><span style="color: black;">)</span>: <span style="color: #483d8b;">'hello'</span>,</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #483d8b;">'pp'</span>: <span style="color: black;">{</span><span style="color: #ff4500;">11</span>: <span style="color: #ff4500;">23</span><span style="color: black;">}</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: black;">}</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">dict2 = <span style="color: black;">{</span><span style="color: #ff4500;">2</span>: <span style="color: black;">[</span><span style="color: #ff4500;">1</span>, <span style="color: #ff4500;">2</span><span style="color: black;">]</span>,</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: black;">(</span><span style="color: #ff4500;">1</span>, <span style="color: #ff4500;">2</span><span style="color: black;">)</span>: <span style="color: #483d8b;">'hello'</span>,</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #483d8b;">'pp'</span>: <span style="color: black;">{</span><span style="color: #ff4500;">12</span>: <span style="color: #ff4500;">23</span><span style="color: black;">}</span><span style="color: black;">}</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;font-weight:bold;">print</span> diff<span style="color: black;">(</span>dict1, dict2<span style="color: black;">)</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;"># Ce qui est dans le premier dictionnaire, mais pas dans le deuxieme</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;"># {1: [1, 2],</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;"># 'pp': {11: 23}</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;"># }</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;"># Ce qui est dans le deuxieme dictionnaire, mais pas dans le premier</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;"># {2: [1, 2],</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;"># 'pp': {12: 23}</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;"># }</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;"># Peut renvoyer un tuple de 2 éléments (les deux afficher juste au dessus),</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;"># ou un dictionnaire, ou autre, du moment que c'est</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;"># facile a utiliser</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li></ol></pre>Bug Clutter2012-12-19T16:37:44+01:00http://codingteam.net/paste/show/777MsieurHappyhttp://codingteam.net/users/show/MsieurHappy<pre class="python" style="font-family:monospace;"><ol><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;font-weight:bold;">from</span> gi.<span style="color: black;">repository</span> <span style="color: #ff7700;font-weight:bold;">import</span> Clutter</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;font-weight:bold;">if</span> Clutter.<span style="color: black;">init</span><span style="color: black;">(</span><span style="color: black;">[</span><span style="color: black;">]</span><span style="color: black;">)</span><span style="color: black;">[</span><span style="color: #ff4500;">0</span><span style="color: black;">]</span> <span style="color: #66cc66;">!</span>= Clutter.<span style="color: black;">InitError</span>.<span style="color: black;">SUCCESS</span>:</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> exit<span style="color: black;">(</span><span style="color: #ff4500;">1</span><span style="color: black;">)</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">actor = Clutter.<span style="color: black;">Actor</span>.<span style="color: #dc143c;">new</span><span style="color: black;">(</span><span style="color: black;">)</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">actor.<span style="color: black;">set_name</span><span style="color: black;">(</span><span style="color: #483d8b;">"foo"</span><span style="color: black;">)</span></div></li></ol></pre>pygobject2012-07-04T16:11:42+02:00http://codingteam.net/paste/show/772Pacohttp://codingteam.net/users/show/Paco<pre class="text" style="font-family:monospace;"><ol><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Starting with PyGObject 3.1.92 there's a module called pygtkcompat which will make it easier to port an application from PyGTK.</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">There are two different approaches to porting your application from PyGTK to gobject-introspection</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> Using a PyGTK compatibility layer (pygtkcompat)</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> Using a shell script which converts the callsites (pygi-convert.sh) </div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">There are advantages and disadvantages with both:</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> Using pygtkcompat makes it possible to focus on porting to Gtk 3.x while not changing anything</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> else, users and developers can keep on using the software as before. </div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> Using pygtkcompat allows you to support both Gtk 2.x and Gtk 3.x with the same code base</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> Using pygi-convert.sh you can avoid using any layers and use the supported API directly </div></li></ol></pre>pouët2012-05-20T19:48:52+02:00http://codingteam.net/paste/show/769xbrighthttp://codingteam.net/users/show/xbright<pre class="text" style="font-family:monospace;"><ol><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><tatayoyo> slt a tous</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">-uBOTu-fr- Merci de parler en français: Pas de SMS & abbréviations.</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">* billgastrik (~billgastr@AMontpellier-652-1-220-87.w81-251.abo.wanadoo.fr) a quitté #ubuntu-fr</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><Minos> slt tatayoyo</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><tatayoyo> j'ai un gro probleme avec flightgear lol</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><tatayoyo> quelqu'un peut m'aidé</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><tatayoyo> svp</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><chabicobi> ubuntu 12.04 n'accepte pas USB CDMA 3G que faire?</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> carbon case_ CasW chabicobi Champi ChanServ Chizka chpo clache clement coyotus Cubox Cytheria </div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><tatayoyo> chabicobi, tu peux m'aider</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><chabicobi> je n'ai jamais rencontré ton problème</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><chabicobi> tatayyo, tu peux m'aider aussi</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><tatayoyo> hein questu di</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><chabicobi> tatayoyo, tu peux m'aider aussi</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><tatayoyo> sa va j't'ai pas insulté</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><tatayoyo> pq tu me cherches ?</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><Ool> !sms |echo tatayoyo</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><uBOTu-fr> tatayoyo Merci d'éviter SMS et Abréviations sur ce canal : http://doc.ubuntu-fr.org/conduiteirc#en_francais_s_il_vous_plait</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">* Slystone (~yaaic@reverse-177-11.fdn.fr) a rejoint #ubuntu-fr</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">* nuanda est parti (Quit: Leaving.)</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><tatayoyo> uBOTu-fr, dacc monsieur l'admin</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">* cadeskywalker (~madoka@put92-2-212-194-144-131.dsl.sta.abo.bbox.fr) a rejoint #ubuntu-fr</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><chabicobi> ma clé internet ne marche pas sur ubuntu 12.04 tatayoyo c'est pas la bagard</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><tatayoyo> vas y me parle pas</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">* uBOTu-fr active le mode +q #ubuntu-fr *!*@90.2.35.121</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><chabicobi> oh mon frère qu' ai je fais de mal ?</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><Ool> restons serein ce dimanche</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><chabicobi> oh mon frère qu' ai je fais de mal ? tatayoyo</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><SurcouF> oh zyva</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><Ool> chabicobi: il ne te répondra plus durant la prochaine heure..</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><tatayoyo> Ool, je suis pas daccord, moi je suis calme</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><Ool> afin qu'il prenne le temps de se calmer un pei</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><tatayoyo> c'est lui il me cherche</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><Ool> peu*</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">* mogitux (~mogwai@def92-3-81-56-11-112.fbx.proxad.net) a rejoint #ubuntu-fr</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><chabicobi> ok tatayoyo exuse moi si je t'ai offensé ce n'était pas mon intension</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><tatayoyo> chabicobi, ben tu me cherches tu me trouves</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><tatayoyo> mais c'est bon on oubli</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><tatayoyo> kiss</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><chabicobi> Ool merci</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><Ool> sinon pour ta clef usb et precise je ne sais pas trop</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><Ool> regarde dans dmesg ce qui en est dit quand tu la branches</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">* olivier est parti (Ping timeout: 245 seconds)</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><Ool> regarde aussi se que te répond lsusb</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><chabicobi> ok merci je vais tenté</div></li></ol></pre>