diff --git a/honeypot/__init__.py b/honeypot/__init__.py index 515d358..91e098e 100644 --- a/honeypot/__init__.py +++ b/honeypot/__init__.py @@ -35,22 +35,19 @@ class RootResource: def get_moin_user(self): email, name = '', '' - try: - moin_data_dir = self._get_wiki_data_dir() - moin_session_dir = os.path.join( - moin_data_dir, - 'cache', - '__session__' - ) - moin_user_id = self._get_user_id(moin_session_dir) - moin_user_file = os.path.join(moin_data_dir, 'user', moin_user_id) - with open(moin_user_file, 'r') as fh: - if 'email=' in line: - email = line.split('=', 1)[1] - if 'name=' in line: - name = line.split('=', 1)[1] - except: - pass + moin_data_dir = self._get_wiki_data_dir() + moin_session_dir = os.path.join( + moin_data_dir, + 'cache', + '__session__' + ) + moin_user_id = self._get_user_id(moin_session_dir) + moin_user_file = os.path.join(moin_data_dir, 'user', moin_user_id) + with open(moin_user_file, 'r') as fh: + if 'email=' in line: + email = line.split('=', 1)[1] + if 'name=' in line: + name = line.split('=', 1)[1] return email, name def _get_wiki_data_dir(self): @@ -118,7 +115,6 @@ def the_view(context, request): def main(global_config, **settings): """ This function returns a Pyramid WSGI application. """ - print(settings) RootResource.pre_init(settings['moin.config_path']) config = Configurator(settings=settings)