~bkidwell/zim/pyzim-win-installer

« back to all changes in this revision

Viewing changes to zim/gui/clipboard.py

  • Committer: Jaap Karssenberg
  • Date: 2011-01-16 18:05:42 UTC
  • Revision ID: pardus@cpan.org-20110116180542-2y6upd4ccqrej3ug
polished previous commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
273
273
                        text = pack_urilist((pagename,))
274
274
                        selectiondata.set(INTERNAL_PAGELIST_TARGET_NAME, 8, text)
275
275
                elif id == PAGELIST_TARGET_ID:
276
 
                        link = "%s?%s\r\n" % (notebookname, pagename)
 
276
                        link = "%s?%s" % (notebookname, pagename)
277
277
                        text = pack_urilist((link,))
278
278
                        selectiondata.set(PAGELIST_TARGET_NAME, 8, text)
279
279
                elif id == TEXT_TARGET_ID:
285
285
                # Callback to clear our cliboard data - pass because we keep no state
286
286
                pass
287
287
 
288
 
        def debug_dump_contents(self):
289
 
                '''Interactively dumps clipboard contents to stdout - used for debug sessions'''
290
 
                import sys
291
 
                targets = self.wait_for_targets()
292
 
                print "="*80
293
 
                print "Enter a number to see a specific target, or <Enter> to exit"
294
 
                print "Available targets:"
295
 
                for i in range(len(targets)):
296
 
                        print i, targets[i]
297
 
                line = sys.stdin.readline().strip()
298
 
                while line:
299
 
                        target = targets[int(line)]
300
 
                        print '>>>>', target
301
 
                        selection = self.wait_for_contents(target)
302
 
                        if selection:
303
 
                                text = selection.get_text()
304
 
                                if not text is None:
305
 
                                        print '== Text:', text
306
 
                                else:
307
 
                                        print '== Data:', selection.data
308
 
                        else:
309
 
                                print '== No contents'
310
 
                        print '<<<<'
311
 
                        line = sys.stdin.readline().strip()
312
 
 
313
288
 
314
289
class Win32HtmlFormat:
315
290
        '''This class adds support for Windows "HTML Format" clipboard content type