Mercurial > hg > index.fcgi > www > www-1
diff pics2/pics_app.py @ 82:d7d67887102f
move pinlib to a shared location and have pics use it
author | paulo |
---|---|
date | Wed, 29 Jun 2016 00:11:55 -0700 |
parents | ec48011dca1e |
children | d521df55f56c |
line diff
1.1 --- a/pics2/pics_app.py Fri Jun 17 22:24:17 2016 -0700 1.2 +++ b/pics2/pics_app.py Wed Jun 29 00:11:55 2016 -0700 1.3 @@ -8,6 +8,8 @@ 1.4 1.5 import html 1.6 1.7 +import pinlib 1.8 + 1.9 import logging 1.10 logging.basicConfig( 1.11 level=logging.INFO, 1.12 @@ -16,18 +18,6 @@ 1.13 ) 1.14 1.15 1.16 -def _lahat(): 1.17 - ret = None 1.18 - 1.19 - try: 1.20 - with open("_lahat") as lahat_f: 1.21 - ret = lahat_f.read().strip() 1.22 - except IOError: 1.23 - pass 1.24 - 1.25 - return ret 1.26 - 1.27 - 1.28 def _is_pics_dir(dirpath): 1.29 return os.path.exists(os.path.join(dirpath, "_picsroot")) 1.30 1.31 @@ -152,7 +142,7 @@ 1.32 1.33 self._qs = urlparse.parse_qs(self._environ["QUERY_STRING"]) 1.34 logging.debug("self._qs = %s" % self._qs) 1.35 - if self._qs.get("lahat", [''])[0] == _lahat(): 1.36 + if pinlib.PinMan("lahat").check(pinlib.parse_cookies(self._environ)): 1.37 self._show_index = True 1.38 1.39 if len(ppi) >= 2 and _is_pics_dir(ppi[1]):