Commits

Mads Sülau Valstorp Jørgensen committed 5c9e6f1

Refactored the cache_key into a method.
Removed google copyright.

  • Participants
  • Parent commits e4e93b5

Comments (0)

Files changed (1)

gae/snapmenow/main.py

 #!/usr/bin/env python
-#
-# Copyright 2007 Google Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
 
 import os
 import uuid
     data = db.BlobProperty()
 
     @staticmethod
+    def get_cache_key(key):
+        return 'image_data_%s' % key
+
+    @staticmethod
     def get_data_by_uuid(key):
-        cache_idx = 'image_data_%s' % key
-        data = memcache.get(cache_idx)
+        cache_idx = Image.get_cache_key(key)
+        data = memcache.get(key)
 
         if not data:
             image = Image.gql('WHERE uuid = :1', key).get()