frontend package¶
Submodules¶
frontend.family module¶
Created on 2021-01-01
@author: wf
-
class
frontend.family.LocalWiki(siteName: str, family=None, localSettings: str = None)[source]¶ Bases:
objecta local Wiki
-
getLogo() → str[source]¶ get the local path to the logo file of this wiki
- Returns
the logo path if logo is defined as file else None
- Return type
str
-
frontend.server module¶
Created on 2021-01-06
@author: wf
-
class
frontend.server.Server[source]¶ Bases:
lodstorage.jsonable.JSONAblea server that might serve multiple wikis for a wikiFarm
-
checkApacheConfiguration(conf, status='enabled') → str[source]¶ check the given apache configuration and return an indicator symbol
- Parameters
conf (str) – the name of the apache configuration
- Returns
a state symbol
-
enableFrontend(siteName)[source]¶ enable the given frontend
- Parameters
siteName (str) – the siteName of the frontend to enable
- Returns
the configured frontend
- Return type
-
getFrontend(wikiId)[source]¶ get the frontend for the given wikiid
- Parameters
wikiId (str) – the wikiId to get the frontend for
- Returns
the frontend for this wikiId
- Return type
-
getPlatformLogo() → str[source]¶ get the logo url for the platform this server runs on
- Returns
the url of the logo for the current operating system platform
- Return type
str
-
getStorePath(prefix: str = 'serverConfig') → str[source]¶ get the path where my store files are located :returns: path to .wikicms in the homedirectory of the current user
-
homePath= None¶
-
sqlBackupState(dbName)[source]¶ get the backup state of the given sql backup
- Parameters
dbName (str) – the name of the database to check
- Returns
backup State
- Return type
dict
-
sqlBackupStateAsHtml(dbName)[source]¶ get the backup state of the given sql backup
- Parameters
dbName (str) – the name of the database to check
- Returns
backup State html representation
- Return type
html
-
frontend.site module¶
Created on 2020-12-31
@author: wf
-
class
frontend.site.Site(name: str, defaultPage: str = 'Main Page', lang: str = 'en')[source]¶ Bases:
objectmigrated from: https://github.com/BITPlan/com.bitplan.wikifrontend/blob/master/src/main/java/com/bitplan/wikifrontend/Site.java
frontend.webserver module¶
Created on 2020-12-30
@author: wf
-
class
frontend.webserver.WikiCMSWeb(host='0.0.0.0', port=8251, debug=False)[source]¶ Bases:
fb4.app.AppWrapWrapper for Flask Web Application
-
adminMenuList(activeItem: str = None)[source]¶ get the list of menu items for the admin menu :param activeItem: the active menu item :type activeItem: str
- Returns
the list of menu items
- Return type
list
-
enableSites(siteNames)[source]¶ enable the sites given in the sites list :param siteNames: a list of strings with wikiIds to be enabled :type siteNames: list
-
family() → str[source]¶ show a html representation of the family of wikis on this server (if any)
- Returns
a html table of all wikis in the family
- Return type
str
-
frontends() → str[source]¶ render the frontends view
- Returns
the html for the admin view
- Return type
str
-
logo(siteName: str) → str[source]¶ render the Logo for the given siteName
- Parameters
siteName (str) – the name of the site e.g. wiki.bitplan.com
- Returns
the rendered Logo for the given Site
-
static
splitPath(path)[source]¶ split the given path :param path: the path to split :type path: str
- Returns
the site of the path an the actual path
- Return type
str,str
-
frontend.widgets module¶
Created on 2021-01-04
@author: wf
-
class
frontend.widgets.Image(url, alt=None, width=None, height=None)[source]¶ Bases:
frontend.widgets.Widgeta HTML Image
-
class
frontend.widgets.Link(url, title, tooltip=None)[source]¶ Bases:
frontend.widgets.Widgeta HTML link
-
class
frontend.widgets.MenuItem(url: str, title: str, active: bool = False)[source]¶ Bases:
frontend.widgets.Widgeta menu item
frontend.wikicms module¶
Created on 2020-07-27
@author: wf
-
class
frontend.wikicms.Frontend(siteName: str, debug: bool = False)[source]¶ Bases:
objectWiki Content Management System Frontend
-
checkPath(pagePath)[source]¶ check the given pathPath
- Parameters
pagePath (str) – the page Path to check
- Returns
None or an error message with the illegal chars being used
- Return type
str
-
getContent(pagePath: str)[source]¶ get the content for the given pagePath :param pagePath: the page Pageh :type pagePath: str
- Returns
the HTML content for the given path
- Return type
str
-
log(msg)[source]¶ log the given message if debugging is true
- Parameters
msg (str) – the message to log
-
needsProxy(path: str) → bool[source]¶ - Parameters
path (str) – the path to check
- Returns
True if this path needs to be proxied
-
proxy(path: str) → str[source]¶ proxy a request see https://stackoverflow.com/a/50231825/1497139
- Parameters
path (str) – the path to proxy
- Returns
the proxied result Request
-