@@ -2018,6 +2018,13 @@ def __getitem__(self, key):
20182018 if isinstance (key , tuple ) and len (key ) == 2 :
20192019 # Fetch a single kind
20202020 key , kind = key
2021+ if kind == "script" :
2022+ keylist = key .split ('/' )
2023+ applist = [app .name for app in self .service .apps ]
2024+ for i in range (len (keylist )):
2025+ if keylist [i ] == "apps" and keylist [i + 1 ] in applist :
2026+ newkey = [keylist [x ] for x in range (i + 2 , len (keylist ))]
2027+ key = "./" + ('/' ).join (newkey )
20212028 key = UrlEncoded (key , encode_slash = True )
20222029 try :
20232030 response = self .get (self .kindpath (kind ) + "/" + key )
@@ -2037,6 +2044,12 @@ def __getitem__(self, key):
20372044 # Iterate over all the kinds looking for matches.
20382045 kind = None
20392046 candidate = None
2047+ keylist = key .split ('/' )
2048+ applist = [app .name for app in self .service .apps ]
2049+ for i in range (len (keylist )):
2050+ if keylist [i ] == "apps" and keylist [i + 1 ] in applist :
2051+ newkey = [keylist [x ] for x in range (i + 2 , len (keylist ))]
2052+ key = "./" + ('/' ).join (newkey )
20402053 key = UrlEncoded (key , encode_slash = True )
20412054 for kind in self .kinds :
20422055 try :
@@ -2213,7 +2226,7 @@ def itemmeta(self, kind):
22132226 def _get_kind_list (self , subpath = None ):
22142227 if subpath is None :
22152228 subpath = []
2216-
2229+
22172230 kinds = []
22182231 response = self .get ('/' .join (subpath ))
22192232 content = _load_atom_entries (response )
0 commit comments