Snake case

main
Bob Mottram 2021-12-25 19:00:00 +00:00
parent deb1f8b20a
commit 5b082ab200
6 changed files with 61 additions and 61 deletions

View File

@ -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

View File

@ -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,

View File

@ -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)

View File

@ -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'] + '</button></a>\n'
# show publish button at the top if needed
if publishButtonAtTop:
if publish_button_at_top:
htmlStr += '<center>' + publishButtonStr + '</center>'
# show a column header image, eg. title of the theme or newswire banner
@ -122,7 +122,7 @@ def getRightColumnContent(base_dir: str, nickname: str, domainFull: str,
'<button class="cancelbtn">' + \
translate['Go Back'] + '</button></a>\n'
if showPublishButton and not publishButtonAtTop:
if showPublishButton and not publish_button_at_top:
if not showPublishAsIcon:
htmlStr += publishButtonStr

View File

@ -45,7 +45,7 @@ def htmlModeration(cssCache: {}, defaultTimeline: str,
fullWidthTimelineButtonHeader: bool,
iconsAsButtons: bool,
rssIconAtTop: bool,
publishButtonAtTop: bool,
publish_button_at_top: bool,
authorized: bool, moderationActionStr: str,
theme: str, peertubeInstances: [],
allow_local_network_access: bool,
@ -72,7 +72,7 @@ def htmlModeration(cssCache: {}, defaultTimeline: str,
showPublishedDateOnly,
newswire, False, False, artist, positiveVoting,
showPublishAsIcon, fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
iconsAsButtons, rssIconAtTop, publish_button_at_top,
authorized, moderationActionStr, theme,
peertubeInstances, allow_local_network_access,
textModeBanner, accessKeys, systemLanguage,

View File

@ -361,7 +361,7 @@ def _htmlTimelineEnd(base_dir: str, nickname: str, domainFull: str,
moderator: bool, editor: bool,
newswire: {}, positiveVoting: bool,
showPublishAsIcon: bool,
rssIconAtTop: bool, publishButtonAtTop: bool,
rssIconAtTop: bool, publish_button_at_top: bool,
authorized: bool, theme: str,
defaultTimeline: str, accessKeys: {},
boxName: str,
@ -381,7 +381,7 @@ def _htmlTimelineEnd(base_dir: str, nickname: str, domainFull: str,
newswire, positiveVoting,
False, None, True,
showPublishAsIcon,
rssIconAtTop, publishButtonAtTop,
rssIconAtTop, publish_button_at_top,
authorized, True, theme,
defaultTimeline, accessKeys)
tlStr += ' <td valign="top" class="col-right" ' + \
@ -437,7 +437,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
fullWidthTimelineButtonHeader: bool,
iconsAsButtons: bool,
rssIconAtTop: bool,
publishButtonAtTop: bool,
publish_button_at_top: bool,
authorized: bool,
moderationActionStr: str,
theme: str,
@ -792,7 +792,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
moderator, editor,
newswire, positiveVoting,
showPublishAsIcon,
rssIconAtTop, publishButtonAtTop,
rssIconAtTop, publish_button_at_top,
authorized, theme,
defaultTimeline, accessKeys,
boxName,
@ -810,7 +810,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
moderator, editor,
newswire, positiveVoting,
showPublishAsIcon,
rssIconAtTop, publishButtonAtTop,
rssIconAtTop, publish_button_at_top,
authorized, theme,
defaultTimeline, accessKeys,
boxName,
@ -958,7 +958,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
moderator, editor,
newswire, positiveVoting,
showPublishAsIcon,
rssIconAtTop, publishButtonAtTop,
rssIconAtTop, publish_button_at_top,
authorized, theme,
defaultTimeline, accessKeys,
boxName,
@ -1133,7 +1133,7 @@ def htmlShares(cssCache: {}, defaultTimeline: str,
fullWidthTimelineButtonHeader: bool,
iconsAsButtons: bool,
rssIconAtTop: bool,
publishButtonAtTop: bool,
publish_button_at_top: bool,
authorized: bool, theme: str,
peertubeInstances: [],
allow_local_network_access: bool,
@ -1164,7 +1164,7 @@ def htmlShares(cssCache: {}, defaultTimeline: str,
newswire, False, False, artist,
positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
iconsAsButtons, rssIconAtTop, publish_button_at_top,
authorized, None, theme, peertubeInstances,
allow_local_network_access, textModeBanner,
accessKeys, systemLanguage, max_like_count,
@ -1188,7 +1188,7 @@ def htmlWanted(cssCache: {}, defaultTimeline: str,
fullWidthTimelineButtonHeader: bool,
iconsAsButtons: bool,
rssIconAtTop: bool,
publishButtonAtTop: bool,
publish_button_at_top: bool,
authorized: bool, theme: str,
peertubeInstances: [],
allow_local_network_access: bool,
@ -1219,7 +1219,7 @@ def htmlWanted(cssCache: {}, defaultTimeline: str,
newswire, False, False, artist,
positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
iconsAsButtons, rssIconAtTop, publish_button_at_top,
authorized, None, theme, peertubeInstances,
allow_local_network_access, textModeBanner,
accessKeys, systemLanguage, max_like_count,
@ -1244,7 +1244,7 @@ def htmlInbox(cssCache: {}, defaultTimeline: str,
fullWidthTimelineButtonHeader: bool,
iconsAsButtons: bool,
rssIconAtTop: bool,
publishButtonAtTop: bool,
publish_button_at_top: bool,
authorized: bool, theme: str,
peertubeInstances: [],
allow_local_network_access: bool,
@ -1275,7 +1275,7 @@ def htmlInbox(cssCache: {}, defaultTimeline: str,
newswire, False, False, artist,
positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
iconsAsButtons, rssIconAtTop, publish_button_at_top,
authorized, None, theme, peertubeInstances,
allow_local_network_access, textModeBanner,
accessKeys, systemLanguage, max_like_count,
@ -1300,7 +1300,7 @@ def htmlBookmarks(cssCache: {}, defaultTimeline: str,
fullWidthTimelineButtonHeader: bool,
iconsAsButtons: bool,
rssIconAtTop: bool,
publishButtonAtTop: bool,
publish_button_at_top: bool,
authorized: bool, theme: str,
peertubeInstances: [],
allow_local_network_access: bool,
@ -1331,7 +1331,7 @@ def htmlBookmarks(cssCache: {}, defaultTimeline: str,
newswire, False, False, artist,
positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
iconsAsButtons, rssIconAtTop, publish_button_at_top,
authorized, None, theme, peertubeInstances,
allow_local_network_access, textModeBanner,
accessKeys, systemLanguage, max_like_count,
@ -1356,7 +1356,7 @@ def htmlInboxDMs(cssCache: {}, defaultTimeline: str,
fullWidthTimelineButtonHeader: bool,
iconsAsButtons: bool,
rssIconAtTop: bool,
publishButtonAtTop: bool,
publish_button_at_top: bool,
authorized: bool, theme: str,
peertubeInstances: [],
allow_local_network_access: bool,
@ -1382,7 +1382,7 @@ def htmlInboxDMs(cssCache: {}, defaultTimeline: str,
newswire, False, False, artist, positiveVoting,
showPublishAsIcon,
fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
iconsAsButtons, rssIconAtTop, publish_button_at_top,
authorized, None, theme, peertubeInstances,
allow_local_network_access, textModeBanner,
accessKeys, systemLanguage, max_like_count,
@ -1407,7 +1407,7 @@ def htmlInboxReplies(cssCache: {}, defaultTimeline: str,
fullWidthTimelineButtonHeader: bool,
iconsAsButtons: bool,
rssIconAtTop: bool,
publishButtonAtTop: bool,
publish_button_at_top: bool,
authorized: bool, theme: str,
peertubeInstances: [],
allow_local_network_access: bool,
@ -1434,7 +1434,7 @@ def htmlInboxReplies(cssCache: {}, defaultTimeline: str,
newswire, False, False, artist,
positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
iconsAsButtons, rssIconAtTop, publish_button_at_top,
authorized, None, theme, peertubeInstances,
allow_local_network_access, textModeBanner,
accessKeys, systemLanguage, max_like_count,
@ -1459,7 +1459,7 @@ def htmlInboxMedia(cssCache: {}, defaultTimeline: str,
fullWidthTimelineButtonHeader: bool,
iconsAsButtons: bool,
rssIconAtTop: bool,
publishButtonAtTop: bool,
publish_button_at_top: bool,
authorized: bool, theme: str,
peertubeInstances: [],
allow_local_network_access: bool,
@ -1486,7 +1486,7 @@ def htmlInboxMedia(cssCache: {}, defaultTimeline: str,
newswire, False, False, artist,
positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
iconsAsButtons, rssIconAtTop, publish_button_at_top,
authorized, None, theme, peertubeInstances,
allow_local_network_access, textModeBanner,
accessKeys, systemLanguage, max_like_count,
@ -1511,7 +1511,7 @@ def htmlInboxBlogs(cssCache: {}, defaultTimeline: str,
fullWidthTimelineButtonHeader: bool,
iconsAsButtons: bool,
rssIconAtTop: bool,
publishButtonAtTop: bool,
publish_button_at_top: bool,
authorized: bool, theme: str,
peertubeInstances: [],
allow_local_network_access: bool,
@ -1538,7 +1538,7 @@ def htmlInboxBlogs(cssCache: {}, defaultTimeline: str,
newswire, False, False, artist,
positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
iconsAsButtons, rssIconAtTop, publish_button_at_top,
authorized, None, theme, peertubeInstances,
allow_local_network_access, textModeBanner,
accessKeys, systemLanguage, max_like_count,
@ -1563,7 +1563,7 @@ def htmlInboxFeatures(cssCache: {}, defaultTimeline: str,
fullWidthTimelineButtonHeader: bool,
iconsAsButtons: bool,
rssIconAtTop: bool,
publishButtonAtTop: bool,
publish_button_at_top: bool,
authorized: bool,
theme: str,
peertubeInstances: [],
@ -1590,7 +1590,7 @@ def htmlInboxFeatures(cssCache: {}, defaultTimeline: str,
newswire, False, False, False,
positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
iconsAsButtons, rssIconAtTop, publish_button_at_top,
authorized, None, theme, peertubeInstances,
allow_local_network_access, textModeBanner,
accessKeys, systemLanguage, max_like_count,
@ -1615,7 +1615,7 @@ def htmlInboxNews(cssCache: {}, defaultTimeline: str,
fullWidthTimelineButtonHeader: bool,
iconsAsButtons: bool,
rssIconAtTop: bool,
publishButtonAtTop: bool,
publish_button_at_top: bool,
authorized: bool, theme: str,
peertubeInstances: [],
allow_local_network_access: bool,
@ -1641,7 +1641,7 @@ def htmlInboxNews(cssCache: {}, defaultTimeline: str,
newswire, moderator, editor, artist,
positiveVoting, showPublishAsIcon,
fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
iconsAsButtons, rssIconAtTop, publish_button_at_top,
authorized, None, theme, peertubeInstances,
allow_local_network_access, textModeBanner,
accessKeys, systemLanguage, max_like_count,
@ -1666,7 +1666,7 @@ def htmlOutbox(cssCache: {}, defaultTimeline: str,
fullWidthTimelineButtonHeader: bool,
iconsAsButtons: bool,
rssIconAtTop: bool,
publishButtonAtTop: bool,
publish_button_at_top: bool,
authorized: bool, theme: str,
peertubeInstances: [],
allow_local_network_access: bool,
@ -1694,7 +1694,7 @@ def htmlOutbox(cssCache: {}, defaultTimeline: str,
showPublishedDateOnly,
newswire, False, False, artist, positiveVoting,
showPublishAsIcon, fullWidthTimelineButtonHeader,
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
iconsAsButtons, rssIconAtTop, publish_button_at_top,
authorized, None, theme, peertubeInstances,
allow_local_network_access, textModeBanner,
accessKeys, systemLanguage, max_like_count,