Example #1
0
	def on_drag_data_received(self, widget, context, x, y, selection, target_type, timestamp):
		if target_type == 80:
			uris = [uri.strip('\r\n\x00') for uri in selection.data.split('\n')]
			#uri = selection.data.strip('\r\n\x00')
			#print 'uri', uri
			path = ''
			if uris[0].startswith('file://'):
				# TODO: Finish this part!
				print 'uri length',len(uris)
				for uri in uris:
					if not uri:
						continue
					imageloader.load_from_uri(urllib.unquote(uri.strip('file:')))
				imageloader.needs_update = True
				imageloader.index = len(imageloader.imglist) - 1
				#imageloader.load_from_uri(urllib.unquote(uris[0].strip('file:')))
				# fullurl = quote(fullurl, safe="%/:=&?~#+!$,;'@()*[]")
			elif uris[0].startswith('http'):
				pass
Example #2
0
 def on_drag_data_received(self, widget, context, x, y, selection,
                           target_type, timestamp):
     if target_type == 80:
         uris = [
             uri.strip('\r\n\x00') for uri in selection.data.split('\n')
         ]
         #uri = selection.data.strip('\r\n\x00')
         #print 'uri', uri
         path = ''
         if uris[0].startswith('file://'):
             # TODO: Finish this part!
             print 'uri length', len(uris)
             for uri in uris:
                 if not uri:
                     continue
                 imageloader.load_from_uri(
                     urllib.unquote(uri.strip('file:')))
             imageloader.needs_update = True
             imageloader.index = len(imageloader.imglist) - 1
             #imageloader.load_from_uri(urllib.unquote(uris[0].strip('file:')))
             # fullurl = quote(fullurl, safe="%/:=&?~#+!$,;'@()*[]")
         elif uris[0].startswith('http'):
             pass
Example #3
0
import argparse
import imageloader

from multiprocessing import Pool
from threading import Thread

parser = argparse.ArgumentParser()
parser.add_argument("openfile", nargs='*')

args = parser.parse_args()

_pool = list()

'''
if args.openfile:
	for i in args.openfile:
		_pool.append(Thread(target=lambda: imageloader.load_from_uri(i)))
		_pool[-1].start()
'''

if args.openfile:
	for i in args.openfile[:-1]:
		imageloader.load_from_uri(i)
	t = imageloader.load_from_uri(args.openfile[-1])
	t.join()
	imageloader.imglist[-1].set_image()
Example #4
0
def open_file_dialog():
	images = _file_dialog()
	for i in images:
		imageloader.load_from_uri(i)
Example #5
0
import argparse
import imageloader

from multiprocessing import Pool
from threading import Thread

parser = argparse.ArgumentParser()
parser.add_argument("openfile", nargs='*')

args = parser.parse_args()

_pool = list()
'''
if args.openfile:
	for i in args.openfile:
		_pool.append(Thread(target=lambda: imageloader.load_from_uri(i)))
		_pool[-1].start()
'''

if args.openfile:
    for i in args.openfile[:-1]:
        imageloader.load_from_uri(i)
    t = imageloader.load_from_uri(args.openfile[-1])
    t.join()
    imageloader.imglist[-1].set_image()