+ if not os.access(imagefile, os.R_OK):
+ print "File access error: %s" % (imagefile)
+ sys.exit(3)
+
+ splitpath = os.path.split(imagefile)
+ # make sure we're in the directory where the image is located
+ if splitpath[0]:
+ os.chdir(splitpath[0])
+
+ # write image file image
+ if not server:
+ server = tn.get_socket().getsockname()[0]
+ if proto == "http":
+ cmd = "load -u %s://%s:%d/%s -r 0\n" % (proto, server, PORT, splitpath[1])
+ else:
+ cmd = "load -u %s://%s/%s -r 0\n" % (proto, server, splitpath[1])
+