Ejemplo n.º 1
0
	def getselected(self):
		self.time=self.doubleSpinBox.value()
		outfile=self.path+"background.xml"
		x = xmlmsg.xml(self.path,(self.time)*60.0-5)
		image.start=""
		try:
			f=open(outfile,'w')
			f.write(x.start)
			for j in self.image:
				if j.checkState():
					i=j.text()
					if image.count==0:
						image.count=image.count+1
						f.write(x.s1+i+x.s2+i+x.s3)
						image.start=i
					else:
						s0='\n<to>'+self.path+i+'</to> \n</transition>'
						f.write(s0+x.s1+i+x.s2+i+x.s3)
						image.count=image.count+1
			f.write("\n<to>"+self.path+image.start+x.end)
			f.close()
			close(outfile)
		except IOError as e:
			QtGui.QMessageBox.critical(self,"IOError",e.__str__())
		if image.count!=0:
			QtGui.QMessageBox.about(self,"XML File Created",xmlmsg.finalmsg(outfile,image.count))
			self.close()
Ejemplo n.º 2
0
 def getselected(self):
     self.time = self.doubleSpinBox.value()
     outfile = self.path + "background.xml"
     x = xmlmsg.xml(self.path, (self.time) * 60.0 - 5)
     image.start = ""
     try:
         f = open(outfile, 'w')
         f.write(x.start)
         for j in self.image:
             if j.checkState():
                 i = j.text()
                 if image.count == 0:
                     image.count = image.count + 1
                     f.write(x.s1 + i + x.s2 + i + x.s3)
                     image.start = i
                 else:
                     s0 = '\n<to>' + self.path + i + '</to> \n</transition>'
                     f.write(s0 + x.s1 + i + x.s2 + i + x.s3)
                     image.count = image.count + 1
         f.write("\n<to>" + self.path + image.start + x.end)
         f.close()
         close(outfile)
     except IOError as e:
         QtGui.QMessageBox.critical(self, "IOError", e.__str__())
     if image.count != 0:
         QtGui.QMessageBox.about(self, "XML File Created",
                                 xmlmsg.finalmsg(outfile, image.count))
         self.close()
Ejemplo n.º 3
0
parser.add_argument('-D','--directory',type=directory,default=os.getenv('HOME')+"/Pictures",help='directory location of image files')

args = parser.parse_args()
if args.Cmd is False:
	try:
		#import PyQt4
		from gui import main
		main()
	except ImportError:
		print ('PyQt4 libary is not found\nTry command line Interface')
		parser.print_help()
else:
	#intitializing varables
	path = os.path.abspath(args.directory)+'/'
	outfile=path+args.path
	dirs = os.listdir(path)
	dirs.sort()
	#main program
	import xmlmsg
	from imagepro import *
	x = xmlmsg.xml(path,(args.time)*60.0-5)
	f=open(outfile,'w')
	f.write(x.start)
	for i in dirs:
		if isimage(i):
			askadd(i,args.action,path,f,x)
	f.write("\n<to>"+path+image.start+x.end)
	f.close()
	close(outfile)

Ejemplo n.º 4
0
                    default=os.getenv('HOME') + "/Pictures",
                    help='directory location of image files')

args = parser.parse_args()
if args.Cmd is False:
    try:
        #import PyQt4
        from gui import main
        main()
    except ImportError:
        print('PyQt4 libary is not found\nTry command line Interface')
        parser.print_help()
else:
    #intitializing varables
    path = os.path.abspath(args.directory) + '/'
    outfile = path + args.path
    dirs = os.listdir(path)
    dirs.sort()
    #main program
    import xmlmsg
    from imagepro import *
    x = xmlmsg.xml(path, (args.time) * 60.0 - 5)
    f = open(outfile, 'w')
    f.write(x.start)
    for i in dirs:
        if isimage(i):
            askadd(i, args.action, path, f, x)
    f.write("\n<to>" + path + image.start + x.end)
    f.close()
    close(outfile)