Support handling events by monitoring an events folder for changes

This commit is contained in:
Micah Lee 2019-11-28 12:24:26 -08:00
parent d78d67adf6
commit e7c683528d
No known key found for this signature in database
GPG key ID: 403C2657CD994F73
7 changed files with 152 additions and 23 deletions

View file

@ -17,6 +17,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import os
from onionshare import strings
from onionshare.onion import Onion
@ -44,6 +46,12 @@ class GuiCommon:
# Start the Onion
self.onion = Onion(common)
# Directory to watch for events
self.events_dir = os.path.join(self.common.build_data_dir(), "events")
if not os.path.exists(self.events_dir):
os.makedirs(self.events_dir, 0o700, True)
self.events_filename = os.path.join(self.events_dir, "events")
self.css = {
# OnionShareGui styles
"tab_widget_new_tab_button": """