Browse Source

removing try/except for bug hunting

main
Holger Frey 7 years ago
parent
commit
9792cf3f69
  1. 30
      honeypot/__init__.py

30
honeypot/__init__.py

@ -35,22 +35,19 @@ class RootResource: @@ -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): @@ -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)

Loading…
Cancel
Save