diff --git a/daemon.py b/daemon.py index cad20c698..4a51bd287 100644 --- a/daemon.py +++ b/daemon.py @@ -2227,9 +2227,9 @@ class PubServer(BaseHTTPRequestHandler): self.server.rssIconAtTop = False if 'publish-button-at-top' in themeDesignerParams: if themeDesignerParams['publish-button-at-top'].lower() == 'true': - self.server.publishButtonAtTop = True + self.server.publish_button_at_top = True else: - self.server.publishButtonAtTop = False + self.server.publish_button_at_top = False if 'newswire-publish-icon' in themeDesignerParams: if themeDesignerParams['newswire-publish-icon'].lower() == 'true': self.server.showPublishAsIcon = True @@ -5027,9 +5027,9 @@ class PubServer(BaseHTTPRequestHandler): self.server.rssIconAtTop = \ getConfigParam(self.server.base_dir, 'rssIconAtTop') - self.server.publishButtonAtTop = \ + self.server.publish_button_at_top = \ getConfigParam(self.server.base_dir, - 'publishButtonAtTop') + 'publish_button_at_top') setNewsAvatar(base_dir, fields['themeDropdown'], http_prefix, @@ -5968,9 +5968,9 @@ class PubServer(BaseHTTPRequestHandler): self.server.rssIconAtTop = \ getConfigParam(base_dir, 'rssIconAtTop') - self.server.publishButtonAtTop = \ + self.server.publish_button_at_top = \ getConfigParam(base_dir, - 'publishButtonAtTop') + 'publish_button_at_top') # only receive DMs from accounts you follow followDMsFilename = \ @@ -10251,7 +10251,7 @@ class PubServer(BaseHTTPRequestHandler): fullWidthTimelineButtonHeader, self.server.iconsAsButtons, self.server.rssIconAtTop, - self.server.publishButtonAtTop, + self.server.publish_button_at_top, authorized, self.server.themeName, self.server.peertubeInstances, @@ -10402,7 +10402,7 @@ class PubServer(BaseHTTPRequestHandler): fullWidthTimelineButtonHeader, self.server.iconsAsButtons, self.server.rssIconAtTop, - self.server.publishButtonAtTop, + self.server.publish_button_at_top, authorized, self.server.themeName, self.server.peertubeInstances, allow_local_network_access, @@ -10545,7 +10545,7 @@ class PubServer(BaseHTTPRequestHandler): fullWidthTimelineButtonHeader, self.server.iconsAsButtons, self.server.rssIconAtTop, - self.server.publishButtonAtTop, + self.server.publish_button_at_top, authorized, self.server.themeName, self.server.peertubeInstances, allow_local_network_access, @@ -10686,7 +10686,7 @@ class PubServer(BaseHTTPRequestHandler): fullWidthTimelineButtonHeader, self.server.iconsAsButtons, self.server.rssIconAtTop, - self.server.publishButtonAtTop, + self.server.publish_button_at_top, authorized, self.server.themeName, self.server.peertubeInstances, @@ -10828,7 +10828,7 @@ class PubServer(BaseHTTPRequestHandler): fullWidthTimelineButtonHeader, self.server.iconsAsButtons, self.server.rssIconAtTop, - self.server.publishButtonAtTop, + self.server.publish_button_at_top, authorized, self.server.themeName, self.server.peertubeInstances, @@ -10980,7 +10980,7 @@ class PubServer(BaseHTTPRequestHandler): fullWidthTimelineButtonHeader, self.server.iconsAsButtons, self.server.rssIconAtTop, - self.server.publishButtonAtTop, + self.server.publish_button_at_top, authorized, self.server.themeName, self.server.peertubeInstances, @@ -11129,7 +11129,7 @@ class PubServer(BaseHTTPRequestHandler): fullWidthTimelineButtonHeader, self.server.iconsAsButtons, self.server.rssIconAtTop, - self.server.publishButtonAtTop, + self.server.publish_button_at_top, authorized, self.server.themeName, self.server.peertubeInstances, @@ -11236,7 +11236,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.fullWidthTimelineButtonHeader, self.server.iconsAsButtons, self.server.rssIconAtTop, - self.server.publishButtonAtTop, + self.server.publish_button_at_top, authorized, self.server.themeName, self.server.peertubeInstances, self.server.allow_local_network_access, @@ -11320,7 +11320,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.fullWidthTimelineButtonHeader, self.server.iconsAsButtons, self.server.rssIconAtTop, - self.server.publishButtonAtTop, + self.server.publish_button_at_top, authorized, self.server.themeName, self.server.peertubeInstances, self.server.allow_local_network_access, @@ -11442,7 +11442,7 @@ class PubServer(BaseHTTPRequestHandler): fullWidthTimelineButtonHeader, self.server.iconsAsButtons, self.server.rssIconAtTop, - self.server.publishButtonAtTop, + self.server.publish_button_at_top, authorized, self.server.themeName, self.server.peertubeInstances, @@ -11580,7 +11580,7 @@ class PubServer(BaseHTTPRequestHandler): fullWidthTimelineButtonHeader, self.server.iconsAsButtons, self.server.rssIconAtTop, - self.server.publishButtonAtTop, + self.server.publish_button_at_top, authorized, self.server.themeName, self.server.peertubeInstances, @@ -11712,7 +11712,7 @@ class PubServer(BaseHTTPRequestHandler): fullWidthTimelineButtonHeader, self.server.iconsAsButtons, self.server.rssIconAtTop, - self.server.publishButtonAtTop, + self.server.publish_button_at_top, authorized, moderationActionStr, self.server.themeName, self.server.peertubeInstances, @@ -18429,7 +18429,7 @@ def runDaemon(content_license_url: str, max_newswire_posts: int, allow_local_network_access: bool, max_feed_item_size_kb: int, - publishButtonAtTop: bool, + publish_button_at_top: bool, rssIconAtTop: bool, iconsAsButtons: bool, fullWidthTimelineButtonHeader: bool, @@ -18672,7 +18672,7 @@ def runDaemon(content_license_url: str, # Whether to show the newswire publish button at the top, # above the header image - httpd.publishButtonAtTop = publishButtonAtTop + httpd.publish_button_at_top = publish_button_at_top # maximum size of individual RSS feed items, in K httpd.max_feed_item_size_kb = max_feed_item_size_kb diff --git a/epicyon.py b/epicyon.py index fb95d33d0..6b83a9e21 100644 --- a/epicyon.py +++ b/epicyon.py @@ -358,8 +358,8 @@ parser.add_argument("--low_bandwidth", type=str2bool, nargs='?', const=True, default=True, help="Whether to use low bandwidth images") -parser.add_argument("--publishButtonAtTop", - dest='publishButtonAtTop', +parser.add_argument("--publish_button_at_top", + dest='publish_button_at_top', type=str2bool, nargs='?', const=True, default=False, help="Whether to show the publish button at the top of " + @@ -3093,10 +3093,10 @@ rssIconAtTop = \ if rssIconAtTop is not None: args.rssIconAtTop = bool(rssIconAtTop) -publishButtonAtTop = \ - getConfigParam(base_dir, 'publishButtonAtTop') -if publishButtonAtTop is not None: - args.publishButtonAtTop = bool(publishButtonAtTop) +publish_button_at_top = \ + getConfigParam(base_dir, 'publish_button_at_top') +if publish_button_at_top is not None: + args.publish_button_at_top = bool(publish_button_at_top) fullWidthTimelineButtonHeader = \ getConfigParam(base_dir, 'fullWidthTimelineButtonHeader') @@ -3227,7 +3227,7 @@ if __name__ == "__main__": args.max_newswire_posts, args.allow_local_network_access, args.max_feed_item_size_kb, - args.publishButtonAtTop, + args.publish_button_at_top, args.rssIconAtTop, args.iconsAsButtons, args.fullWidthTimelineButtonHeader, diff --git a/theme.py b/theme.py index 5d4b34450..ca0bb7464 100644 --- a/theme.py +++ b/theme.py @@ -224,7 +224,7 @@ def _setPublishButtonAtTop(base_dir: str, atTop: bool) -> bool: configJson = loadJson(configFilename, 0) if not configJson: return False - configJson['publishButtonAtTop'] = atTop + configJson['publish_button_at_top'] = atTop return saveJson(configJson, configFilename) diff --git a/webapp_column_right.py b/webapp_column_right.py index 06faadd87..4963157f3 100644 --- a/webapp_column_right.py +++ b/webapp_column_right.py @@ -55,7 +55,7 @@ def getRightColumnContent(base_dir: str, nickname: str, domainFull: str, showPublishButton: bool, showPublishAsIcon: bool, rssIconAtTop: bool, - publishButtonAtTop: bool, + publish_button_at_top: bool, authorized: bool, showHeaderImage: bool, theme: str, @@ -88,7 +88,7 @@ def getRightColumnContent(base_dir: str, nickname: str, domainFull: str, translate['Login'] + '\n' # show publish button at the top if needed - if publishButtonAtTop: + if publish_button_at_top: htmlStr += '