Here is the final solution to the issue, I suggest the file_blob_storage 
modification and renaming the existing files for everyone, it's extremely 
clumsy to utilize special characters in file names (macos seems to handle 
"/" in the file name, don't know why "/" is used instead of ":" as windows, 
the modification renames the file name, existing urls and references keep 
working, yet a refactoring is needed for the files themselves)

*file_blob_storage.py modification*
  def _FileForBlob(self, blob_key):
    blob_key = self._BlobKey(blob_key)
    return os.path.join(self._DirectoryForBlob(blob_key), 
str(blob_key)[1:].replace("/",";").replace(":",";"))
This ensures that files have ";" instead of "/" or ":"

*To pull out the special files from the windows SDK*

1) Go to blob_image.py's serve_image function and pass/comment out 
the datastore.Get(key) check (because we're going to ping files from the 
serving url scheme, this ensures every file is served from that url scheme)
2) Modify file_blob_storage.py to copy the accessed files to a new location 
(from the old SDK)
def _FileForBlob(self, blob_key):
    blob_key = self._BlobKey(blob_key); handle=False
    path=os.path.join(self._DirectoryForBlob(blob_key), str(blob_key)[1:])
    if path.find("ncoded")!=-1: handle=True
    if handle and not kaan_marked.get(blob_key):
        logging.info("YEY %s"%blob_key)
        kaan_marked[blob_key]=True
        blob_file = self._FileForBlob(blob_key)
        input = _local_open(blob_file, 'rb')
        output= _local_open("C:/GCS/"+str(blob_key)[1:].replace(":",";")
,'wb')
        try:
          while True:
            block = input.read(1 << 20)
            if not block:
                break
            output.write(block)
        finally:
          output.close()
    logging.info(path)
    return os.path.join(self._DirectoryForBlob(blob_key), str(blob_key)[1:])

3) Ping each image, I decided to ping them by browsing the 
"__GsFileInfo__"'s from the Datastore VIewer, couldn't access them easily 
programatically
gg=document.getElementsByTagName("td"); for(var i=0;i<gg.length;i++) 
if(gg[i].innerHTML.indexOf("ncoded")!=-1) { var image = 
document.createElement("img"); image.src = 
"http://localhost/_ah/img/"+gg[i].innerHTML.trim(); 
document.body.appendChild(image); }

Then put the images back to the old or new "n" folder

I think all windows SDK users should do this, I don't know how macos 
handles "/" in the filenames, yet I would suggest everyone to fix the file 
access manually
I've added this to my list of manual sdk modifications, currently I have 9 
manual modifications, sad ... :)

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.

Reply via email to