Opened 7 years ago

Closed 7 years ago

#8055 closed enhancement (fixed)

Convert config file to be a singleton instance

Reported by: hellais Owned by: hellais
Priority: Medium Milestone:
Component: Archived/Ooni Version:
Severity: Keywords: ooni, ooni_easy
Cc: aagbsn, isis, ioerror Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

The config.py currently uses some hacks to make sure that it does not get instanced twice. What we should actually be using is a metaclass constructor that looks like the one evilaliv3 wrote for GlobaLeaks.

This is the class: https://github.com/globaleaks/GLBackend/blob/c900929c8893ed5da47ea057845dfce486f25a26/globaleaks/utils/singleton.py

And this is how it's used:

https://github.com/globaleaks/GLBackend/blob/c900929c8893ed5da47ea057845dfce486f25a26/globaleaks/config.py#L56

Child Tickets

Change History (2)

comment:1 Changed 7 years ago by hellais

Status: newneeds_revision

This is actually redudant since this can easily be implemented with modules as suggested in: http://stackoverflow.com/a/31887

comment:2 Changed 7 years ago by hellais

Resolution: fixed
Status: needs_revisionclosed
Note: See TracTickets for help on using tickets.