code stringlengths 3 6.57k |
|---|
grid.Add(self.bt_about, pos=(row, 1) |
grid.Add((0, spacing) |
wx.StaticBox(panel, wx.ID_ANY, _("Server Settings") |
wx.StaticBoxSizer(server_settings, wx.VERTICAL) |
grid.Add(server_box, pos=(row, 0) |
wx.BoxSizer(wx.HORIZONTAL) |
server_box.Add(hbox, flag=wx.EXPAND) |
wx.StaticText(panel) |
hbox.Add(self.lb_host, flag=wx.ALIGN_CENTER_VERTICAL) |
hbox.AddStretchSpacer() |
wx.StaticText(panel) |
hbox.Add(self.lb_port, flag=wx.ALIGN_CENTER_VERTICAL) |
hbox.AddStretchSpacer() |
wx.Button(panel, label=_("S&ettings...") |
self.bt_settings.Bind(wx.EVT_BUTTON, self.on_settings_clicked) |
hbox.Add(self.bt_settings) |
server_box.AddSpacer(spacing) |
_("Automatically open &browser") |
self.cb_start_browser.SetValue(True) |
server_box.Add(self.cb_start_browser) |
server_box.AddStretchSpacer() |
server_box.AddSpacer(spacing) |
wx.Button(panel, label=_("&Start server") |
self.bt_server.Bind(wx.EVT_BUTTON, self.on_start_server_clicked) |
server_box.Add(self.bt_server, flag=wx.EXPAND) |
unicode(get_port(self.host, 80) |
wx.BoxSizer(wx.VERTICAL) |
action_vbox.AddSpacer(3 * spacing) |
grid.Add(action_vbox, pos=(row, 1) |
wx.Button(panel, label=_("&Backup database...") |
self.bt_backup.Bind(wx.EVT_BUTTON, self.on_backup_clicked) |
action_vbox.Add(self.bt_backup) |
action_vbox.AddSpacer(spacing) |
wx.Button(panel, label=_("S&ync database") |
self.bt_sync_db.Bind(wx.EVT_BUTTON, self.on_syncdb_clicked) |
action_vbox.Add(self.bt_sync_db) |
action_vbox.AddSpacer(spacing) |
wx.Button(panel, label=_("&Reset admin") |
self.bt_reset_admin.Bind(wx.EVT_BUTTON, self.on_reset_admin_clicked) |
action_vbox.Add(self.bt_reset_admin) |
RunCommandControl(panel) |
self.cmd_run_ctrl.Bind(EVT_RUN_CMD, self.on_run_cmd_changed) |
grid.AddGrowableCol(0) |
grid.AddGrowableRow(3) |
wx.BoxSizer(wx.VERTICAL) |
panel.SetSizerAndFit(box) |
self.Fit() |
self.SetMinSize(self.ClientToWindowSize(box.GetMinSize() |
self.SetInitialSize(wx.Size(500, 400) |
self.Bind(wx.EVT_CLOSE, self.on_close) |
initialize_gui(self) |
detect_openslides_type() |
get_default_user_data_path(openslides_type) |
_("Error: Portable directory not writable") |
self.load_gui_settings() |
self.apply_backup_settings() |
backup_interval_seconds(self) |
host(self) |
host(self, host) |
self.lb_host.SetLabel(_("Host: {0}") |
format(host) |
port(self) |
port(self, port) |
self.lb_port.SetLabel(_("Port: {0}") |
format(port) |
load_gui_settings(self) |
open(self.gui_settings_path, "rb") |
json.load(f) |
setattr_unless_none(attr, value) |
setattr(self, attr, value) |
settings.get("database_backup", {}) |
setattr_unless_none("backupdb_enabled", backup_settings.get("enabled") |
backup_settings.get("destination") |
backup_settings.get("interval") |
backup_settings.get("interval_unit") |
backup_settings.get("last_backup") |
settings.get("server_settings", {}) |
setattr_unless_none("host", server_settings.get("host") |
setattr_unless_none("port", server_settings.get("port") |
save_gui_settings(self) |
self.last_backup.strftime("%Y-%m-%d %H:%M:%S") |
os.path.dirname(self.gui_settings_path) |
os.path.exists(dp) |
os.makedirs(dp) |
open(self.gui_settings_path, "wb") |
json.dump(settings, f, ensure_ascii=False, indent=4) |
apply_backup_settings(self) |
datetime.datetime.utcnow() |
datetime.timedelta(seconds=self.backup_interval_seconds) |
self.backup_timer.Start(seconds * 1000, True) |
self.backup_timer.Stop() |
do_backup(self) |
p.stdin.close() |
p.stdout.read() |
strip() |
p.wait() |
self.cmd_run_ctrl.append_message(output) |
datetime.datetime.now() |
strftime("%Y-%m-%d %H:%M:%S") |
_("{0}: Database backup successful.") |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.