Snake case

main
Bob Mottram 2021-12-25 18:05:01 +00:00
parent 43c2684781
commit 8c6b0f3149
15 changed files with 207 additions and 194 deletions

135
daemon.py
View File

@ -1298,7 +1298,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.showPublishedDateOnly,
self.server.allowLocalNetworkAccess,
city, self.server.systemLanguage,
self.server.sharedItemsFederatedDomains,
self.server.shared_items_federated_domains,
self.server.sharedItemFederationTokens,
self.server.lowBandwidth,
self.server.signingPrivateKeyPem,
@ -3613,8 +3613,8 @@ class PubServer(BaseHTTPRequestHandler):
return
elif searchStr.startswith('.'):
# wanted items search
sharedItemsFederatedDomains = \
self.server.sharedItemsFederatedDomains
shared_items_federated_domains = \
self.server.shared_items_federated_domains
wantedItemsStr = \
htmlSearchSharedItems(self.server.cssCache,
self.server.translate,
@ -3624,7 +3624,7 @@ class PubServer(BaseHTTPRequestHandler):
http_prefix,
domainFull,
actorStr, callingDomain,
sharedItemsFederatedDomains,
shared_items_federated_domains,
'wanted')
if wantedItemsStr:
msg = wantedItemsStr.encode('utf-8')
@ -3636,8 +3636,8 @@ class PubServer(BaseHTTPRequestHandler):
return
else:
# shared items search
sharedItemsFederatedDomains = \
self.server.sharedItemsFederatedDomains
shared_items_federated_domains = \
self.server.shared_items_federated_domains
sharedItemsStr = \
htmlSearchSharedItems(self.server.cssCache,
self.server.translate,
@ -3647,7 +3647,7 @@ class PubServer(BaseHTTPRequestHandler):
http_prefix,
domainFull,
actorStr, callingDomain,
sharedItemsFederatedDomains,
shared_items_federated_domains,
'shares')
if sharedItemsStr:
msg = sharedItemsStr.encode('utf-8')
@ -5586,15 +5586,17 @@ class PubServer(BaseHTTPRequestHandler):
# shared item federation domains
siDomainUpdated = False
sharedItemsFederatedDomainsStr = \
fed_domains_variable = \
"shared_items_federated_domains"
fed_domains_str = \
getConfigParam(base_dir,
"sharedItemsFederatedDomains")
if not sharedItemsFederatedDomainsStr:
sharedItemsFederatedDomainsStr = ''
fed_domains_variable)
if not fed_domains_str:
fed_domains_str = ''
sharedItemsFormStr = ''
if fields.get('shareDomainList'):
sharedItemsList = \
sharedItemsFederatedDomainsStr.split(',')
fed_domains_str.split(',')
for sharedFederatedDomain in sharedItemsList:
sharedItemsFormStr += \
sharedFederatedDomain.strip() + '\n'
@ -5605,14 +5607,14 @@ class PubServer(BaseHTTPRequestHandler):
sharedItemsFormStr2 = \
shareDomainList.replace('\n', ',')
sharedItemsField = \
"sharedItemsFederatedDomains"
"shared_items_federated_domains"
setConfigParam(base_dir, sharedItemsField,
sharedItemsFormStr2)
siDomainUpdated = True
else:
if sharedItemsFederatedDomainsStr:
if fed_domains_str:
sharedItemsField = \
"sharedItemsFederatedDomains"
"shared_items_federated_domains"
setConfigParam(base_dir, sharedItemsField,
'')
siDomainUpdated = True
@ -5620,7 +5622,7 @@ class PubServer(BaseHTTPRequestHandler):
siDomains = sharedItemsFormStr.split('\n')
siTokens = \
self.server.sharedItemFederationTokens
self.server.sharedItemsFederatedDomains = \
self.server.shared_items_federated_domains = \
siDomains
domainFull = self.server.domainFull
self.server.sharedItemFederationTokens = \
@ -9710,7 +9712,7 @@ class PubServer(BaseHTTPRequestHandler):
accessKeys, city,
self.server.systemLanguage,
self.server.maxLikeCount,
self.server.sharedItemsFederatedDomains,
self.server.shared_items_federated_domains,
rolesList,
None, None, self.server.CWlists,
self.server.listsEnabled,
@ -9792,8 +9794,8 @@ class PubServer(BaseHTTPRequestHandler):
city = getSpoofedCity(self.server.city,
base_dir,
nickname, domain)
sharedItemsFederatedDomains = \
self.server.sharedItemsFederatedDomains
shared_items_federated_domains = \
self.server.shared_items_federated_domains
signingPrivateKeyPem = \
self.server.signingPrivateKeyPem
content_license_url = \
@ -9826,7 +9828,7 @@ class PubServer(BaseHTTPRequestHandler):
accessKeys, city,
self.server.systemLanguage,
self.server.maxLikeCount,
sharedItemsFederatedDomains,
shared_items_federated_domains,
skills,
None, None,
self.server.CWlists,
@ -10218,8 +10220,8 @@ class PubServer(BaseHTTPRequestHandler):
accessKeys = \
self.server.keyShortcuts[nickname]
sharedItemsFederatedDomains = \
self.server.sharedItemsFederatedDomains
shared_items_federated_domains = \
self.server.shared_items_federated_domains
msg = htmlInbox(self.server.cssCache,
defaultTimeline,
recentPostsCache,
@ -10256,7 +10258,7 @@ class PubServer(BaseHTTPRequestHandler):
accessKeys,
self.server.systemLanguage,
self.server.maxLikeCount,
sharedItemsFederatedDomains,
shared_items_federated_domains,
self.server.signingPrivateKeyPem,
self.server.CWlists,
self.server.listsEnabled)
@ -10366,8 +10368,8 @@ class PubServer(BaseHTTPRequestHandler):
accessKeys = \
self.server.keyShortcuts[nickname]
sharedItemsFederatedDomains = \
self.server.sharedItemsFederatedDomains
shared_items_federated_domains = \
self.server.shared_items_federated_domains
msg = \
htmlInboxDMs(self.server.cssCache,
self.server.defaultTimeline,
@ -10404,7 +10406,7 @@ class PubServer(BaseHTTPRequestHandler):
accessKeys,
self.server.systemLanguage,
self.server.maxLikeCount,
sharedItemsFederatedDomains,
shared_items_federated_domains,
self.server.signingPrivateKeyPem,
self.server.CWlists,
self.server.listsEnabled)
@ -10507,8 +10509,8 @@ class PubServer(BaseHTTPRequestHandler):
accessKeys = \
self.server.keyShortcuts[nickname]
sharedItemsFederatedDomains = \
self.server.sharedItemsFederatedDomains
shared_items_federated_domains = \
self.server.shared_items_federated_domains
msg = \
htmlInboxReplies(self.server.cssCache,
self.server.defaultTimeline,
@ -10545,7 +10547,7 @@ class PubServer(BaseHTTPRequestHandler):
accessKeys,
self.server.systemLanguage,
self.server.maxLikeCount,
sharedItemsFederatedDomains,
shared_items_federated_domains,
self.server.signingPrivateKeyPem,
self.server.CWlists,
self.server.listsEnabled)
@ -10647,6 +10649,8 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.keyShortcuts.get(nickname):
accessKeys = \
self.server.keyShortcuts[nickname]
fed_domains = \
self.server.shared_items_federated_domains
msg = \
htmlInboxMedia(self.server.cssCache,
@ -10685,7 +10689,7 @@ class PubServer(BaseHTTPRequestHandler):
accessKeys,
self.server.systemLanguage,
self.server.maxLikeCount,
self.server.sharedItemsFederatedDomains,
fed_domains,
self.server.signingPrivateKeyPem,
self.server.CWlists,
self.server.listsEnabled)
@ -10787,6 +10791,8 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.keyShortcuts.get(nickname):
accessKeys = \
self.server.keyShortcuts[nickname]
fed_domains = \
self.server.shared_items_federated_domains
msg = \
htmlInboxBlogs(self.server.cssCache,
@ -10825,7 +10831,7 @@ class PubServer(BaseHTTPRequestHandler):
accessKeys,
self.server.systemLanguage,
self.server.maxLikeCount,
self.server.sharedItemsFederatedDomains,
fed_domains,
self.server.signingPrivateKeyPem,
self.server.CWlists,
self.server.listsEnabled)
@ -10936,6 +10942,8 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.keyShortcuts.get(nickname):
accessKeys = \
self.server.keyShortcuts[nickname]
fed_domains = \
self.server.shared_items_federated_domains
msg = \
htmlInboxNews(self.server.cssCache,
@ -10975,7 +10983,7 @@ class PubServer(BaseHTTPRequestHandler):
accessKeys,
self.server.systemLanguage,
self.server.maxLikeCount,
self.server.sharedItemsFederatedDomains,
fed_domains,
self.server.signingPrivateKeyPem,
self.server.CWlists,
self.server.listsEnabled)
@ -11083,8 +11091,8 @@ class PubServer(BaseHTTPRequestHandler):
accessKeys = \
self.server.keyShortcuts[nickname]
sharedItemsFederatedDomains = \
self.server.sharedItemsFederatedDomains
shared_items_federated_domains = \
self.server.shared_items_federated_domains
msg = \
htmlInboxFeatures(self.server.cssCache,
self.server.defaultTimeline,
@ -11122,7 +11130,7 @@ class PubServer(BaseHTTPRequestHandler):
accessKeys,
self.server.systemLanguage,
self.server.maxLikeCount,
sharedItemsFederatedDomains,
shared_items_federated_domains,
self.server.signingPrivateKeyPem,
self.server.CWlists,
self.server.listsEnabled)
@ -11228,7 +11236,7 @@ class PubServer(BaseHTTPRequestHandler):
accessKeys,
self.server.systemLanguage,
self.server.maxLikeCount,
self.server.sharedItemsFederatedDomains,
self.server.shared_items_federated_domains,
self.server.signingPrivateKeyPem,
self.server.CWlists,
self.server.listsEnabled)
@ -11312,7 +11320,7 @@ class PubServer(BaseHTTPRequestHandler):
accessKeys,
self.server.systemLanguage,
self.server.maxLikeCount,
self.server.sharedItemsFederatedDomains,
self.server.shared_items_federated_domains,
self.server.signingPrivateKeyPem,
self.server.CWlists,
self.server.listsEnabled)
@ -11394,8 +11402,8 @@ class PubServer(BaseHTTPRequestHandler):
accessKeys = \
self.server.keyShortcuts[nickname]
sharedItemsFederatedDomains = \
self.server.sharedItemsFederatedDomains
shared_items_federated_domains = \
self.server.shared_items_federated_domains
msg = \
htmlBookmarks(self.server.cssCache,
self.server.defaultTimeline,
@ -11433,7 +11441,7 @@ class PubServer(BaseHTTPRequestHandler):
accessKeys,
self.server.systemLanguage,
self.server.maxLikeCount,
sharedItemsFederatedDomains,
shared_items_federated_domains,
self.server.signingPrivateKeyPem,
self.server.CWlists,
self.server.listsEnabled)
@ -11571,7 +11579,7 @@ class PubServer(BaseHTTPRequestHandler):
accessKeys,
self.server.systemLanguage,
self.server.maxLikeCount,
self.server.sharedItemsFederatedDomains,
self.server.shared_items_federated_domains,
self.server.signingPrivateKeyPem,
self.server.CWlists,
self.server.listsEnabled)
@ -11661,8 +11669,8 @@ class PubServer(BaseHTTPRequestHandler):
accessKeys = \
self.server.keyShortcuts[nickname]
sharedItemsFederatedDomains = \
self.server.sharedItemsFederatedDomains
shared_items_federated_domains = \
self.server.shared_items_federated_domains
twitterReplacementDomain = \
self.server.twitterReplacementDomain
msg = \
@ -11701,7 +11709,7 @@ class PubServer(BaseHTTPRequestHandler):
accessKeys,
self.server.systemLanguage,
self.server.maxLikeCount,
sharedItemsFederatedDomains,
shared_items_federated_domains,
self.server.signingPrivateKeyPem,
self.server.CWlists,
self.server.listsEnabled)
@ -11822,7 +11830,7 @@ class PubServer(BaseHTTPRequestHandler):
accessKeys, city,
self.server.systemLanguage,
self.server.maxLikeCount,
self.server.sharedItemsFederatedDomains,
self.server.shared_items_federated_domains,
shares,
pageNumber, sharesPerPage,
self.server.CWlists,
@ -11943,7 +11951,7 @@ class PubServer(BaseHTTPRequestHandler):
accessKeys, city,
self.server.systemLanguage,
self.server.maxLikeCount,
self.server.sharedItemsFederatedDomains,
self.server.shared_items_federated_domains,
following,
pageNumber,
followsPerPage,
@ -12063,7 +12071,7 @@ class PubServer(BaseHTTPRequestHandler):
accessKeys, city,
self.server.systemLanguage,
self.server.maxLikeCount,
self.server.sharedItemsFederatedDomains,
self.server.shared_items_federated_domains,
followers,
pageNumber,
followsPerPage,
@ -12199,7 +12207,7 @@ class PubServer(BaseHTTPRequestHandler):
accessKeys, city,
self.server.systemLanguage,
self.server.maxLikeCount,
self.server.sharedItemsFederatedDomains,
self.server.shared_items_federated_domains,
None, None, None,
self.server.CWlists,
self.server.listsEnabled,
@ -13477,7 +13485,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.headers.get('Origin') and \
self.headers.get('Authorization'):
permittedDomains = \
self.server.sharedItemsFederatedDomains
self.server.shared_items_federated_domains
sharedItemTokens = self.server.sharedItemFederationTokens
if authorizeSharedItems(permittedDomains,
self.server.base_dir,
@ -13569,7 +13577,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.headers.get('Origin') and \
self.headers.get('Authorization'):
permittedDomains = \
self.server.sharedItemsFederatedDomains
self.server.shared_items_federated_domains
sharedItemTokens = self.server.sharedItemFederationTokens
if authorizeSharedItems(permittedDomains,
self.server.base_dir,
@ -14167,7 +14175,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.domain, nickname,
self.server.http_prefix, self.server.domainFull,
itemID, self.server.translate,
self.server.sharedItemsFederatedDomains,
self.server.shared_items_federated_domains,
self.server.defaultTimeline,
self.server.themeName, 'shares', category)
if not msg:
@ -14206,7 +14214,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.domain, nickname,
self.server.http_prefix, self.server.domainFull,
itemID, self.server.translate,
self.server.sharedItemsFederatedDomains,
self.server.shared_items_federated_domains,
self.server.defaultTimeline,
self.server.themeName, 'wanted', category)
if not msg:
@ -14987,7 +14995,7 @@ class PubServer(BaseHTTPRequestHandler):
iconsAsButtons = self.server.iconsAsButtons
defaultTimeline = self.server.defaultTimeline
sharedItemsDomains = \
self.server.sharedItemsFederatedDomains
self.server.shared_items_federated_domains
msg = htmlLinksMobile(self.server.cssCache,
self.server.base_dir, nickname,
self.server.domainFull,
@ -17915,21 +17923,21 @@ class PubServer(BaseHTTPRequestHandler):
self.headers.get('SharesCatalog'):
if self.server.debug:
print('SharesCatalog header: ' + self.headers['SharesCatalog'])
if not self.server.sharedItemsFederatedDomains:
if not self.server.shared_items_federated_domains:
siDomainsStr = getConfigParam(self.server.base_dir,
'sharedItemsFederatedDomains')
'shared_items_federated_domains')
if siDomainsStr:
if self.server.debug:
print('Loading shared items federated domains list')
siDomainsList = siDomainsStr.split(',')
domainsList = self.server.sharedItemsFederatedDomains
domainsList = self.server.shared_items_federated_domains
for siDomain in siDomainsList:
domainsList.append(siDomain.strip())
originDomain = self.headers.get('Origin')
if originDomain != self.server.domainFull and \
originDomain != self.server.onionDomain and \
originDomain != self.server.i2pDomain and \
originDomain in self.server.sharedItemsFederatedDomains:
originDomain in self.server.shared_items_federated_domains:
if self.server.debug:
print('DEBUG: ' +
'POST updating shared item federation ' +
@ -17944,13 +17952,14 @@ class PubServer(BaseHTTPRequestHandler):
self.server.debug,
sharedItemTokens)
elif self.server.debug:
if originDomain not in self.server.sharedItemsFederatedDomains:
fed_domains = self.server.shared_items_federated_domains
if originDomain not in fed_domains:
print('originDomain is not in federated domains list ' +
originDomain)
else:
print('originDomain is not a different instance. ' +
originDomain + ' ' + self.server.domainFull + ' ' +
str(self.server.sharedItemsFederatedDomains))
str(fed_domains))
fitnessPerformance(POSTstartTime, self.server.fitness,
'_POST', 'SharesCatalog',
@ -18395,7 +18404,7 @@ def runDaemon(content_license_url: str,
default_reply_interval_hrs: int,
lowBandwidth: bool,
maxLikeCount: int,
sharedItemsFederatedDomains: [],
shared_items_federated_domains: [],
userAgentsBlocked: [],
logLoginFailures: bool,
city: str,
@ -18695,7 +18704,8 @@ def runDaemon(content_license_url: str,
httpd.http_prefix = http_prefix
httpd.debug = debug
httpd.federationList = fedList.copy()
httpd.sharedItemsFederatedDomains = sharedItemsFederatedDomains.copy()
httpd.shared_items_federated_domains = \
shared_items_federated_domains.copy()
httpd.base_dir = base_dir
httpd.instanceId = instanceId
httpd.personCache = {}
@ -18862,8 +18872,9 @@ def runDaemon(content_license_url: str,
httpd.fontsCache = {}
# create tokens used for shared item federation
fed_domains = httpd.shared_items_federated_domains
httpd.sharedItemFederationTokens = \
generateSharedItemFederationTokens(httpd.sharedItemsFederatedDomains,
generateSharedItemFederationTokens(fed_domains,
base_dir)
httpd.sharedItemFederationTokens = \
createSharedItemFederationToken(base_dir, httpd.domainFull, False,

View File

@ -298,7 +298,7 @@ parser.add_argument('--rss', dest='rss', type=str, default=None,
parser.add_argument('-f', '--federate', nargs='+', dest='federationList',
help='Specify federation list separated by spaces')
parser.add_argument('--federateshares', nargs='+',
dest='sharedItemsFederatedDomains',
dest='shared_items_federated_domains',
help='Specify federation list for shared items, ' +
'separated by spaces')
parser.add_argument("--following", "--followingList",
@ -2603,22 +2603,22 @@ if args.desktop:
if federationList:
print('Federating with: ' + str(federationList))
if args.sharedItemsFederatedDomains:
if args.shared_items_federated_domains:
print('Federating shared items with: ' +
args.sharedItemsFederatedDomains)
args.shared_items_federated_domains)
sharedItemsFederatedDomains = []
if args.sharedItemsFederatedDomains:
sharedItemsFederatedDomainsStr = args.sharedItemsFederatedDomains
setConfigParam(base_dir, 'sharedItemsFederatedDomains',
sharedItemsFederatedDomainsStr)
shared_items_federated_domains = []
if args.shared_items_federated_domains:
fed_domains_str = args.shared_items_federated_domains
setConfigParam(base_dir, 'shared_items_federated_domains',
fed_domains_str)
else:
sharedItemsFederatedDomainsStr = \
getConfigParam(base_dir, 'sharedItemsFederatedDomains')
if sharedItemsFederatedDomainsStr:
sharedItemsFederatedDomainsList = sharedItemsFederatedDomainsStr.split(',')
for sharedFederatedDomain in sharedItemsFederatedDomainsList:
sharedItemsFederatedDomains.append(sharedFederatedDomain.strip())
fed_domains_str = \
getConfigParam(base_dir, 'shared_items_federated_domains')
if fed_domains_str:
fed_domains_list = fed_domains_str.split(',')
for sharedFederatedDomain in fed_domains_list:
shared_items_federated_domains.append(sharedFederatedDomain.strip())
if args.block:
if not nickname:
@ -3214,7 +3214,7 @@ if __name__ == "__main__":
listsEnabled,
args.default_reply_interval_hrs,
args.lowBandwidth, args.maxLikeCount,
sharedItemsFederatedDomains,
shared_items_federated_domains,
userAgentsBlocked,
args.logLoginFailures,
args.city,

View File

@ -2620,15 +2620,15 @@ def _sendToGroupMembers(session, base_dir: str, handle: str, port: int,
print(handle + ' sending to group members')
sharedItemFederationTokens = {}
sharedItemsFederatedDomains = []
sharedItemsFederatedDomainsStr = \
getConfigParam(base_dir, 'sharedItemsFederatedDomains')
if sharedItemsFederatedDomainsStr:
shared_items_federated_domains = []
shared_items_federated_domainsStr = \
getConfigParam(base_dir, 'shared_items_federated_domains')
if shared_items_federated_domainsStr:
siFederatedDomainsList = \
sharedItemsFederatedDomainsStr.split(',')
shared_items_federated_domainsStr.split(',')
for sharedFederatedDomain in siFederatedDomainsList:
domainStr = sharedFederatedDomain.strip()
sharedItemsFederatedDomains.append(domainStr)
shared_items_federated_domains.append(domainStr)
followersFile = base_dir + '/accounts/' + handle + '/followers.txt'
if not os.path.isfile(followersFile):
@ -2671,7 +2671,7 @@ def _sendToGroupMembers(session, base_dir: str, handle: str, port: int,
sendThreads, postLog,
cachedWebfingers, personCache,
announceJson, debug, __version__,
sharedItemsFederatedDomains,
shared_items_federated_domains,
sharedItemFederationTokens,
signingPrivateKeyPem)
@ -3047,7 +3047,7 @@ def _receiveQuestionVote(base_dir: str, nickname: str, domain: str,
# if the votes on a question have changed then
# send out an update
questionJson['type'] = 'Update'
sharedItemsFederatedDomains = []
shared_items_federated_domains = []
sharedItemFederationTokens = {}
sendToFollowersThread(session, base_dir, nickname, domain,
onionDomain, i2pDomain, port,
@ -3055,7 +3055,7 @@ def _receiveQuestionVote(base_dir: str, nickname: str, domain: str,
sendThreads, postLog,
cachedWebfingers, personCache,
postJsonObject, debug, __version__,
sharedItemsFederatedDomains,
shared_items_federated_domains,
sharedItemFederationTokens,
signingPrivateKeyPem)

View File

@ -192,7 +192,7 @@ def postMessageToOutbox(session, translate: {},
showPublishedDateOnly: bool,
allowLocalNetworkAccess: bool,
city: str, systemLanguage: str,
sharedItemsFederatedDomains: [],
shared_items_federated_domains: [],
sharedItemFederationTokens: {},
lowBandwidth: bool,
signingPrivateKeyPem: str,
@ -521,7 +521,7 @@ def postMessageToOutbox(session, translate: {},
personCache,
messageJson, debug,
version,
sharedItemsFederatedDomains,
shared_items_federated_domains,
sharedItemFederationTokens,
signingPrivateKeyPem)
followersThreads.append(followersThread)
@ -662,7 +662,7 @@ def postMessageToOutbox(session, translate: {},
personCache,
messageJson, debug,
version,
sharedItemsFederatedDomains,
shared_items_federated_domains,
sharedItemFederationTokens,
signingPrivateKeyPem)
followersThreads.append(namedAddressesThread)

View File

@ -2274,7 +2274,7 @@ def sendPost(signingPrivateKeyPem: str, projectVersion: str,
federationList: [], sendThreads: [], postLog: [],
cachedWebfingers: {}, personCache: {},
isArticle: bool, systemLanguage: str,
sharedItemsFederatedDomains: [],
shared_items_federated_domains: [],
sharedItemFederationTokens: {},
lowBandwidth: bool, content_license_url: str,
debug: bool = False, inReplyTo: str = None,
@ -2377,7 +2377,7 @@ def sendPost(signingPrivateKeyPem: str, projectVersion: str,
# if the "to" domain is within the shared items
# federation list then send the token for this domain
# so that it can request a catalog
if toDomain in sharedItemsFederatedDomains:
if toDomain in shared_items_federated_domains:
domainFull = getFullDomain(domain, port)
if sharedItemFederationTokens.get(domainFull):
signatureHeaderJson['Origin'] = domainFull
@ -2388,8 +2388,8 @@ def sendPost(signingPrivateKeyPem: str, projectVersion: str,
elif debug:
print(domainFull + ' not in sharedItemFederationTokens')
elif debug:
print(toDomain + ' not in sharedItemsFederatedDomains ' +
str(sharedItemsFederatedDomains))
print(toDomain + ' not in shared_items_federated_domains ' +
str(shared_items_federated_domains))
if debug:
print('signatureHeaderJson: ' + str(signatureHeaderJson))
@ -2864,7 +2864,7 @@ def _sendToNamedAddresses(session, base_dir: str,
cachedWebfingers: {}, personCache: {},
postJsonObject: {}, debug: bool,
projectVersion: str,
sharedItemsFederatedDomains: [],
shared_items_federated_domains: [],
sharedItemFederationTokens: {},
signingPrivateKeyPem: str) -> None:
"""sends a post to the specific named addresses in to/cc
@ -2990,7 +2990,7 @@ def _sendToNamedAddresses(session, base_dir: str,
# federation list then send the token for this domain
# so that it can request a catalog
sharedItemsToken = None
if toDomain in sharedItemsFederatedDomains:
if toDomain in shared_items_federated_domains:
if sharedItemFederationTokens.get(fromDomainFull):
sharedItemsToken = sharedItemFederationTokens[fromDomainFull]
@ -3015,7 +3015,7 @@ def sendToNamedAddressesThread(session, base_dir: str,
cachedWebfingers: {}, personCache: {},
postJsonObject: {}, debug: bool,
projectVersion: str,
sharedItemsFederatedDomains: [],
shared_items_federated_domains: [],
sharedItemFederationTokens: {},
signingPrivateKeyPem: str):
"""Returns a thread used to send a post to named addresses
@ -3030,7 +3030,7 @@ def sendToNamedAddressesThread(session, base_dir: str,
cachedWebfingers, personCache,
postJsonObject, debug,
projectVersion,
sharedItemsFederatedDomains,
shared_items_federated_domains,
sharedItemFederationTokens,
signingPrivateKeyPem), daemon=True)
try:
@ -3091,7 +3091,7 @@ def sendToFollowers(session, base_dir: str,
cachedWebfingers: {}, personCache: {},
postJsonObject: {}, debug: bool,
projectVersion: str,
sharedItemsFederatedDomains: [],
shared_items_federated_domains: [],
sharedItemFederationTokens: {},
signingPrivateKeyPem: str) -> None:
"""sends a post to the followers of the given nickname
@ -3137,7 +3137,7 @@ def sendToFollowers(session, base_dir: str,
# federation list then send the token for this domain
# so that it can request a catalog
sharedItemsToken = None
if followerDomain in sharedItemsFederatedDomains:
if followerDomain in shared_items_federated_domains:
domainFull = getFullDomain(domain, port)
if sharedItemFederationTokens.get(domainFull):
sharedItemsToken = sharedItemFederationTokens[domainFull]
@ -3264,7 +3264,7 @@ def sendToFollowersThread(session, base_dir: str,
cachedWebfingers: {}, personCache: {},
postJsonObject: {}, debug: bool,
projectVersion: str,
sharedItemsFederatedDomains: [],
shared_items_federated_domains: [],
sharedItemFederationTokens: {},
signingPrivateKeyPem: str):
"""Returns a thread used to send a post to followers
@ -3279,7 +3279,7 @@ def sendToFollowersThread(session, base_dir: str,
cachedWebfingers, personCache,
postJsonObject.copy(), debug,
projectVersion,
sharedItemsFederatedDomains,
shared_items_federated_domains,
sharedItemFederationTokens,
signingPrivateKeyPem), daemon=True)
try:

View File

@ -119,7 +119,7 @@ def _updatePostSchedule(base_dir: str, handle: str, httpd,
httpd.showPublishedDateOnly,
httpd.allowLocalNetworkAccess,
httpd.city, httpd.systemLanguage,
httpd.sharedItemsFederatedDomains,
httpd.shared_items_federated_domains,
httpd.sharedItemFederationTokens,
httpd.lowBandwidth,
httpd.signingPrivateKeyPem,

View File

@ -1369,11 +1369,11 @@ def sharesCatalogCSVEndpoint(base_dir: str, http_prefix: str,
return csvStr
def generateSharedItemFederationTokens(sharedItemsFederatedDomains: [],
def generateSharedItemFederationTokens(shared_items_federated_domains: [],
base_dir: str) -> {}:
"""Generates tokens for shared item federated domains
"""
if not sharedItemsFederatedDomains:
if not shared_items_federated_domains:
return {}
tokensJson = {}
@ -1386,7 +1386,7 @@ def generateSharedItemFederationTokens(sharedItemsFederatedDomains: [],
tokensJson = {}
tokensAdded = False
for domainFull in sharedItemsFederatedDomains:
for domainFull in shared_items_federated_domains:
if not tokensJson.get(domainFull):
tokensJson[domainFull] = ''
tokensAdded = True
@ -1482,7 +1482,7 @@ def createSharedItemFederationToken(base_dir: str,
return tokensJson
def authorizeSharedItems(sharedItemsFederatedDomains: [],
def authorizeSharedItems(shared_items_federated_domains: [],
base_dir: str,
originDomainFull: str,
callingDomainFull: str,
@ -1491,14 +1491,14 @@ def authorizeSharedItems(sharedItemsFederatedDomains: [],
tokensJson: {} = None) -> bool:
"""HTTP simple token check for shared item federation
"""
if not sharedItemsFederatedDomains:
if not shared_items_federated_domains:
# no shared item federation
return False
if originDomainFull not in sharedItemsFederatedDomains:
if originDomainFull not in shared_items_federated_domains:
if debug:
print(originDomainFull +
' is not in the shared items federation list ' +
str(sharedItemsFederatedDomains))
str(shared_items_federated_domains))
return False
if 'Basic ' in authHeader:
if debug:
@ -1539,7 +1539,7 @@ def authorizeSharedItems(sharedItemsFederatedDomains: [],
return True
def _updateFederatedSharesCache(session, sharedItemsFederatedDomains: [],
def _updateFederatedSharesCache(session, shared_items_federated_domains: [],
base_dir: str, domainFull: str,
http_prefix: str,
tokensJson: {}, debug: bool,
@ -1564,7 +1564,7 @@ def _updateFederatedSharesCache(session, sharedItemsFederatedDomains: [],
"Accept": "application/ld+json",
"Origin": domainFull
}
for federatedDomainFull in sharedItemsFederatedDomains:
for federatedDomainFull in shared_items_federated_domains:
# NOTE: federatedDomain does not have a port extension,
# so may not work in some situations
if federatedDomainFull.startswith(domainFull):
@ -1691,8 +1691,9 @@ def _regenerateSharesToken(base_dir: str, domainFull: str,
createSharedItemFederationToken(base_dir, domainFull, True, None)
_generateNextSharesTokenUpdate(base_dir, minDays, maxDays)
# update the tokens used within the daemon
shared_fed_domains = httpd.shared_items_federated_domains
httpd.sharedItemFederationTokens = \
generateSharedItemFederationTokens(httpd.sharedItemsFederatedDomains,
generateSharedItemFederationTokens(shared_fed_domains,
base_dir)
@ -1709,9 +1710,9 @@ def runFederatedSharesDaemon(base_dir: str, httpd, http_prefix: str,
maxDays = 14
_generateNextSharesTokenUpdate(base_dir, minDays, maxDays)
while True:
sharedItemsFederatedDomainsStr = \
getConfigParam(base_dir, 'sharedItemsFederatedDomains')
if not sharedItemsFederatedDomainsStr:
shared_items_federated_domainsStr = \
getConfigParam(base_dir, 'shared_items_federated_domains')
if not shared_items_federated_domainsStr:
time.sleep(fileCheckIntervalSec)
continue
@ -1720,12 +1721,12 @@ def runFederatedSharesDaemon(base_dir: str, httpd, http_prefix: str,
_regenerateSharesToken(base_dir, domainFull, minDays, maxDays, httpd)
# get a list of the domains within the shared items federation
sharedItemsFederatedDomains = []
sharedItemsFederatedDomainsList = \
sharedItemsFederatedDomainsStr.split(',')
for sharedFederatedDomain in sharedItemsFederatedDomainsList:
sharedItemsFederatedDomains.append(sharedFederatedDomain.strip())
if not sharedItemsFederatedDomains:
shared_items_federated_domains = []
fed_domains_list = \
shared_items_federated_domainsStr.split(',')
for shared_fed_domain in fed_domains_list:
shared_items_federated_domains.append(shared_fed_domain.strip())
if not shared_items_federated_domains:
time.sleep(fileCheckIntervalSec)
continue
@ -1742,7 +1743,8 @@ def runFederatedSharesDaemon(base_dir: str, httpd, http_prefix: str,
session = createSession(proxyType)
for sharesFileType in getSharesFilesList():
_updateFederatedSharesCache(session, sharedItemsFederatedDomains,
_updateFederatedSharesCache(session,
shared_items_federated_domains,
base_dir, domainFull, http_prefix,
tokensJson, debug, systemLanguage,
sharesFileType)

View File

@ -687,7 +687,7 @@ def createServerAlice(path: str, domain: str, port: int,
shutil.rmtree(path, ignore_errors=False, onerror=None)
os.mkdir(path)
os.chdir(path)
sharedItemsFederatedDomains = []
shared_items_federated_domains = []
systemLanguage = 'en'
nickname = 'alice'
http_prefix = 'http'
@ -799,7 +799,7 @@ def createServerAlice(path: str, domain: str, port: int,
runDaemon(content_license_url,
listsEnabled, default_reply_interval_hrs,
lowBandwidth, maxLikeCount,
sharedItemsFederatedDomains,
shared_items_federated_domains,
userAgentsBlocked,
logLoginFailures, city,
showNodeInfoAccounts,
@ -831,7 +831,7 @@ def createServerBob(path: str, domain: str, port: int,
shutil.rmtree(path, ignore_errors=False, onerror=None)
os.mkdir(path)
os.chdir(path)
sharedItemsFederatedDomains = []
shared_items_federated_domains = []
systemLanguage = 'en'
nickname = 'bob'
http_prefix = 'http'
@ -941,7 +941,7 @@ def createServerBob(path: str, domain: str, port: int,
runDaemon(content_license_url,
listsEnabled, default_reply_interval_hrs,
lowBandwidth, maxLikeCount,
sharedItemsFederatedDomains,
shared_items_federated_domains,
userAgentsBlocked,
logLoginFailures, city,
showNodeInfoAccounts,
@ -972,7 +972,7 @@ def createServerEve(path: str, domain: str, port: int, federationList: [],
shutil.rmtree(path, ignore_errors=False, onerror=None)
os.mkdir(path)
os.chdir(path)
sharedItemsFederatedDomains = []
shared_items_federated_domains = []
nickname = 'eve'
http_prefix = 'http'
proxyType = None
@ -1011,7 +1011,7 @@ def createServerEve(path: str, domain: str, port: int, federationList: [],
runDaemon(content_license_url,
listsEnabled, default_reply_interval_hrs,
lowBandwidth, maxLikeCount,
sharedItemsFederatedDomains,
shared_items_federated_domains,
userAgentsBlocked,
logLoginFailures, city,
showNodeInfoAccounts,
@ -1041,7 +1041,7 @@ def createServerGroup(path: str, domain: str, port: int,
shutil.rmtree(path, ignore_errors=False, onerror=None)
os.mkdir(path)
os.chdir(path)
sharedItemsFederatedDomains = []
shared_items_federated_domains = []
# systemLanguage = 'en'
nickname = 'testgroup'
http_prefix = 'http'
@ -1083,7 +1083,7 @@ def createServerGroup(path: str, domain: str, port: int,
runDaemon(content_license_url,
listsEnabled, default_reply_interval_hrs,
lowBandwidth, maxLikeCount,
sharedItemsFederatedDomains,
shared_items_federated_domains,
userAgentsBlocked,
logLoginFailures, city,
showNodeInfoAccounts,
@ -1723,8 +1723,8 @@ def testSharedItemsFederation(base_dir: str) -> None:
print("Alice and Bob agree to share items catalogs")
assert os.path.isdir(aliceDir)
assert os.path.isdir(bobDir)
setConfigParam(aliceDir, 'sharedItemsFederatedDomains', bobAddress)
setConfigParam(bobDir, 'sharedItemsFederatedDomains', aliceAddress)
setConfigParam(aliceDir, 'shared_items_federated_domains', bobAddress)
setConfigParam(bobDir, 'shared_items_federated_domains', aliceAddress)
print('*********************************************************')
print('Alice sends a follow request to Bob')
@ -5629,10 +5629,10 @@ def _testGetLinksFromContent():
def _testAuthorizeSharedItems():
print('testAuthorizeSharedItems')
sharedItemsFederatedDomains = \
shared_items_fed_domains = \
['dog.domain', 'cat.domain', 'birb.domain']
tokensJson = \
generateSharedItemFederationTokens(sharedItemsFederatedDomains, None)
generateSharedItemFederationTokens(shared_items_fed_domains, None)
tokensJson = \
createSharedItemFederationToken(None, 'cat.domain', False, tokensJson)
assert tokensJson
@ -5642,11 +5642,11 @@ def _testAuthorizeSharedItems():
assert len(tokensJson['dog.domain']) == 0
assert len(tokensJson['cat.domain']) >= 64
assert len(tokensJson['birb.domain']) == 0
assert not authorizeSharedItems(sharedItemsFederatedDomains, None,
assert not authorizeSharedItems(shared_items_fed_domains, None,
'birb.domain',
'cat.domain', 'M' * 86,
False, tokensJson)
assert authorizeSharedItems(sharedItemsFederatedDomains, None,
assert authorizeSharedItems(shared_items_fed_domains, None,
'birb.domain',
'cat.domain', tokensJson['cat.domain'],
False, tokensJson)
@ -5657,10 +5657,10 @@ def _testAuthorizeSharedItems():
assert tokensJson['dog.domain'] == 'testToken'
# the shared item federation list changes
sharedItemsFederatedDomains = \
shared_items_federated_domains = \
['possum.domain', 'cat.domain', 'birb.domain']
tokensJson = mergeSharedItemTokens(None, '',
sharedItemsFederatedDomains,
shared_items_federated_domains,
tokensJson)
assert 'dog.domain' not in tokensJson
assert 'cat.domain' in tokensJson

View File

@ -37,7 +37,7 @@ def _getLeftColumnShares(base_dir: str,
nickname: str,
maxSharesInLeftColumn: int,
translate: {},
sharedItemsFederatedDomains: []) -> []:
shared_items_federated_domains: []) -> []:
"""get any shares and turn them into the left column links format
"""
pageNumber = 1
@ -47,7 +47,7 @@ def _getLeftColumnShares(base_dir: str,
sharesJson, lastPage = \
sharesTimelineJson(actor, pageNumber, maxSharesInLeftColumn,
base_dir, domain, nickname, maxSharesInLeftColumn,
sharedItemsFederatedDomains, 'shares')
shared_items_federated_domains, 'shares')
if not sharesJson:
return []
@ -79,7 +79,7 @@ def _getLeftColumnWanted(base_dir: str,
nickname: str,
maxSharesInLeftColumn: int,
translate: {},
sharedItemsFederatedDomains: []) -> []:
shared_items_federated_domains: []) -> []:
"""get any wanted items and turn them into the left column links format
"""
pageNumber = 1
@ -89,7 +89,7 @@ def _getLeftColumnWanted(base_dir: str,
sharesJson, lastPage = \
sharesTimelineJson(actor, pageNumber, maxSharesInLeftColumn,
base_dir, domain, nickname, maxSharesInLeftColumn,
sharedItemsFederatedDomains, 'wanted')
shared_items_federated_domains, 'wanted')
if not sharesJson:
return []
@ -119,7 +119,7 @@ def getLeftColumnContent(base_dir: str, nickname: str, domainFull: str,
rssIconAtTop: bool, showHeaderImage: bool,
frontPage: bool, theme: str,
accessKeys: {},
sharedItemsFederatedDomains: []) -> str:
shared_items_federated_domains: []) -> str:
"""Returns html content for the left column
"""
htmlStr = ''
@ -220,7 +220,7 @@ def getLeftColumnContent(base_dir: str, nickname: str, domainFull: str,
_getLeftColumnShares(base_dir,
http_prefix, domain, domainFull, nickname,
maxSharesInLeftColumn, translate,
sharedItemsFederatedDomains)
shared_items_federated_domains)
if linksList and sharesList:
linksList = sharesList + linksList
@ -228,7 +228,7 @@ def getLeftColumnContent(base_dir: str, nickname: str, domainFull: str,
_getLeftColumnWanted(base_dir,
http_prefix, domain, domainFull, nickname,
maxSharesInLeftColumn, translate,
sharedItemsFederatedDomains)
shared_items_federated_domains)
if linksList and wantedList:
linksList = wantedList + linksList
@ -356,7 +356,7 @@ def htmlLinksMobile(cssCache: {}, base_dir: str,
iconsAsButtons: bool,
defaultTimeline: str,
theme: str, accessKeys: {},
sharedItemsFederatedDomains: []) -> str:
shared_items_federated_domains: []) -> str:
"""Show the left column links within mobile view
"""
htmlStr = ''
@ -400,7 +400,7 @@ def htmlLinksMobile(cssCache: {}, base_dir: str,
False, timelinePath,
rssIconAtTop, False, False,
theme, accessKeys,
sharedItemsFederatedDomains)
shared_items_federated_domains)
if editor and not _linksExist(base_dir):
htmlStr += '<br><br><br>\n<center>\n '
htmlStr += translate['Select the edit icon to add web links']

View File

@ -110,7 +110,7 @@ def htmlFrontScreen(signingPrivateKeyPem: str,
allowLocalNetworkAccess: bool,
accessKeys: {},
systemLanguage: str, maxLikeCount: int,
sharedItemsFederatedDomains: [],
shared_items_federated_domains: [],
extraJson: {},
pageNumber: int,
maxItemsPerPage: int,
@ -158,7 +158,7 @@ def htmlFrontScreen(signingPrivateKeyPem: str,
False, False,
False, None, rssIconAtTop, True,
True, theme, accessKeys,
sharedItemsFederatedDomains)
shared_items_federated_domains)
profileHeaderStr += \
' </td>\n' + \
' <td valign="top" class="col-center">\n'

View File

@ -52,7 +52,7 @@ def htmlModeration(cssCache: {}, defaultTimeline: str,
textModeBanner: str,
accessKeys: {}, systemLanguage: str,
maxLikeCount: int,
sharedItemsFederatedDomains: [],
shared_items_federated_domains: [],
signingPrivateKeyPem: str,
CWlists: {}, listsEnabled: str) -> str:
"""Show the moderation feed as html
@ -76,7 +76,7 @@ def htmlModeration(cssCache: {}, defaultTimeline: str,
authorized, moderationActionStr, theme,
peertubeInstances, allowLocalNetworkAccess,
textModeBanner, accessKeys, systemLanguage,
maxLikeCount, sharedItemsFederatedDomains,
maxLikeCount, shared_items_federated_domains,
signingPrivateKeyPem, CWlists, listsEnabled)

View File

@ -556,7 +556,7 @@ def htmlProfile(signingPrivateKeyPem: str,
textModeBanner: str,
debug: bool, accessKeys: {}, city: str,
systemLanguage: str, maxLikeCount: int,
sharedItemsFederatedDomains: [],
shared_items_federated_domains: [],
extraJson: {}, pageNumber: int,
maxItemsPerPage: int,
CWlists: {}, listsEnabled: str,
@ -582,7 +582,7 @@ def htmlProfile(signingPrivateKeyPem: str,
newswire, theme, extraJson,
allowLocalNetworkAccess, accessKeys,
systemLanguage, maxLikeCount,
sharedItemsFederatedDomains, None,
shared_items_federated_domains, None,
pageNumber, maxItemsPerPage, CWlists,
listsEnabled)
@ -1574,12 +1574,12 @@ def _htmlEditProfileSharedItems(base_dir: str, nickname: str, domain: str,
"""shared items section of edit profile screen
"""
sharedItemsStr = ''
sharedItemsFederatedDomainsStr = \
getConfigParam(base_dir, 'sharedItemsFederatedDomains')
if sharedItemsFederatedDomainsStr:
sharedItemsFederatedDomainsList = \
sharedItemsFederatedDomainsStr.split(',')
for sharedFederatedDomain in sharedItemsFederatedDomainsList:
shared_items_federated_domainsStr = \
getConfigParam(base_dir, 'shared_items_federated_domains')
if shared_items_federated_domainsStr:
shared_items_federated_domainsList = \
shared_items_federated_domainsStr.split(',')
for sharedFederatedDomain in shared_items_federated_domainsList:
sharedItemsStr += sharedFederatedDomain.strip() + '\n'
editProfileForm = beginEditSection(translate['Shares'])

View File

@ -224,7 +224,7 @@ def htmlSearchSharedItems(cssCache: {}, translate: {},
http_prefix: str,
domainFull: str, actor: str,
callingDomain: str,
sharedItemsFederatedDomains: [],
shared_items_federated_domains: [],
sharesFileType: str) -> str:
"""Search results for shared items
"""
@ -294,7 +294,7 @@ def htmlSearchSharedItems(cssCache: {}, translate: {},
if not f.endswith('.' + sharesFileType + '.json'):
continue
federatedDomain = f.split('.')[0]
if federatedDomain not in sharedItemsFederatedDomains:
if federatedDomain not in shared_items_federated_domains:
continue
sharesFilename = catalogsDir + '/' + f
sharesJson = loadJson(sharesFilename)

View File

@ -446,7 +446,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
textModeBanner: str,
accessKeys: {}, systemLanguage: str,
maxLikeCount: int,
sharedItemsFederatedDomains: [],
shared_items_federated_domains: [],
signingPrivateKeyPem: str,
CWlists: {}, listsEnabled: str) -> str:
"""Show the timeline as html
@ -747,7 +747,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
http_prefix, translate,
editor, artist, False, None, rssIconAtTop,
True, False, theme, accessKeys,
sharedItemsFederatedDomains)
shared_items_federated_domains)
tlStr += ' <td valign="top" class="col-left" ' + \
'id="links" tabindex="-1">' + \
leftColumnStr + ' </td>\n'
@ -786,7 +786,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
_htmlSharesTimeline(translate, pageNumber, itemsPerPage,
base_dir, actor, nickname, domain, port,
maxSharesPerAccount, http_prefix,
sharedItemsFederatedDomains, 'shares') +
shared_items_federated_domains, 'shares') +
_htmlTimelineEnd(base_dir, nickname, domainFull,
http_prefix, translate,
moderator, editor,
@ -804,7 +804,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
_htmlSharesTimeline(translate, pageNumber, itemsPerPage,
base_dir, actor, nickname, domain, port,
maxSharesPerAccount, http_prefix,
sharedItemsFederatedDomains, 'wanted') +
shared_items_federated_domains, 'wanted') +
_htmlTimelineEnd(base_dir, nickname, domainFull,
http_prefix, translate,
moderator, editor,
@ -1043,14 +1043,14 @@ def _htmlSharesTimeline(translate: {}, pageNumber: int, itemsPerPage: int,
base_dir: str, actor: str,
nickname: str, domain: str, port: int,
maxSharesPerAccount: int, http_prefix: str,
sharedItemsFederatedDomains: [],
shared_items_federated_domains: [],
sharesFileType: str) -> str:
"""Show shared items timeline as html
"""
sharesJson, lastPage = \
sharesTimelineJson(actor, pageNumber, itemsPerPage,
base_dir, domain, nickname, maxSharesPerAccount,
sharedItemsFederatedDomains, sharesFileType)
shared_items_federated_domains, sharesFileType)
domainFull = getFullDomain(domain, port)
actor = localActorUrl(http_prefix, nickname, domainFull)
adminNickname = getConfigParam(base_dir, 'admin')
@ -1140,7 +1140,7 @@ def htmlShares(cssCache: {}, defaultTimeline: str,
textModeBanner: str,
accessKeys: {}, systemLanguage: str,
maxLikeCount: int,
sharedItemsFederatedDomains: [],
shared_items_federated_domains: [],
signingPrivateKeyPem: str,
CWlists: {}, listsEnabled: str) -> str:
"""Show the shares timeline as html
@ -1168,7 +1168,7 @@ def htmlShares(cssCache: {}, defaultTimeline: str,
authorized, None, theme, peertubeInstances,
allowLocalNetworkAccess, textModeBanner,
accessKeys, systemLanguage, maxLikeCount,
sharedItemsFederatedDomains, signingPrivateKeyPem,
shared_items_federated_domains, signingPrivateKeyPem,
CWlists, listsEnabled)
@ -1195,7 +1195,7 @@ def htmlWanted(cssCache: {}, defaultTimeline: str,
textModeBanner: str,
accessKeys: {}, systemLanguage: str,
maxLikeCount: int,
sharedItemsFederatedDomains: [],
shared_items_federated_domains: [],
signingPrivateKeyPem: str,
CWlists: {}, listsEnabled: str) -> str:
"""Show the wanted timeline as html
@ -1223,7 +1223,7 @@ def htmlWanted(cssCache: {}, defaultTimeline: str,
authorized, None, theme, peertubeInstances,
allowLocalNetworkAccess, textModeBanner,
accessKeys, systemLanguage, maxLikeCount,
sharedItemsFederatedDomains, signingPrivateKeyPem,
shared_items_federated_domains, signingPrivateKeyPem,
CWlists, listsEnabled)
@ -1251,7 +1251,7 @@ def htmlInbox(cssCache: {}, defaultTimeline: str,
textModeBanner: str,
accessKeys: {}, systemLanguage: str,
maxLikeCount: int,
sharedItemsFederatedDomains: [],
shared_items_federated_domains: [],
signingPrivateKeyPem: str,
CWlists: {}, listsEnabled: str) -> str:
"""Show the inbox as html
@ -1279,7 +1279,7 @@ def htmlInbox(cssCache: {}, defaultTimeline: str,
authorized, None, theme, peertubeInstances,
allowLocalNetworkAccess, textModeBanner,
accessKeys, systemLanguage, maxLikeCount,
sharedItemsFederatedDomains, signingPrivateKeyPem,
shared_items_federated_domains, signingPrivateKeyPem,
CWlists, listsEnabled)
@ -1307,7 +1307,7 @@ def htmlBookmarks(cssCache: {}, defaultTimeline: str,
textModeBanner: str,
accessKeys: {}, systemLanguage: str,
maxLikeCount: int,
sharedItemsFederatedDomains: [],
shared_items_federated_domains: [],
signingPrivateKeyPem: str,
CWlists: {}, listsEnabled: str) -> str:
"""Show the bookmarks as html
@ -1335,7 +1335,7 @@ def htmlBookmarks(cssCache: {}, defaultTimeline: str,
authorized, None, theme, peertubeInstances,
allowLocalNetworkAccess, textModeBanner,
accessKeys, systemLanguage, maxLikeCount,
sharedItemsFederatedDomains, signingPrivateKeyPem,
shared_items_federated_domains, signingPrivateKeyPem,
CWlists, listsEnabled)
@ -1363,7 +1363,7 @@ def htmlInboxDMs(cssCache: {}, defaultTimeline: str,
textModeBanner: str,
accessKeys: {}, systemLanguage: str,
maxLikeCount: int,
sharedItemsFederatedDomains: [],
shared_items_federated_domains: [],
signingPrivateKeyPem: str,
CWlists: {}, listsEnabled: str) -> str:
"""Show the DM timeline as html
@ -1386,7 +1386,7 @@ def htmlInboxDMs(cssCache: {}, defaultTimeline: str,
authorized, None, theme, peertubeInstances,
allowLocalNetworkAccess, textModeBanner,
accessKeys, systemLanguage, maxLikeCount,
sharedItemsFederatedDomains, signingPrivateKeyPem,
shared_items_federated_domains, signingPrivateKeyPem,
CWlists, listsEnabled)
@ -1414,7 +1414,7 @@ def htmlInboxReplies(cssCache: {}, defaultTimeline: str,
textModeBanner: str,
accessKeys: {}, systemLanguage: str,
maxLikeCount: int,
sharedItemsFederatedDomains: [],
shared_items_federated_domains: [],
signingPrivateKeyPem: str,
CWlists: {}, listsEnabled: str) -> str:
"""Show the replies timeline as html
@ -1438,7 +1438,7 @@ def htmlInboxReplies(cssCache: {}, defaultTimeline: str,
authorized, None, theme, peertubeInstances,
allowLocalNetworkAccess, textModeBanner,
accessKeys, systemLanguage, maxLikeCount,
sharedItemsFederatedDomains, signingPrivateKeyPem,
shared_items_federated_domains, signingPrivateKeyPem,
CWlists, listsEnabled)
@ -1466,7 +1466,7 @@ def htmlInboxMedia(cssCache: {}, defaultTimeline: str,
textModeBanner: str,
accessKeys: {}, systemLanguage: str,
maxLikeCount: int,
sharedItemsFederatedDomains: [],
shared_items_federated_domains: [],
signingPrivateKeyPem: str,
CWlists: {}, listsEnabled: str) -> str:
"""Show the media timeline as html
@ -1490,7 +1490,7 @@ def htmlInboxMedia(cssCache: {}, defaultTimeline: str,
authorized, None, theme, peertubeInstances,
allowLocalNetworkAccess, textModeBanner,
accessKeys, systemLanguage, maxLikeCount,
sharedItemsFederatedDomains, signingPrivateKeyPem,
shared_items_federated_domains, signingPrivateKeyPem,
CWlists, listsEnabled)
@ -1518,7 +1518,7 @@ def htmlInboxBlogs(cssCache: {}, defaultTimeline: str,
textModeBanner: str,
accessKeys: {}, systemLanguage: str,
maxLikeCount: int,
sharedItemsFederatedDomains: [],
shared_items_federated_domains: [],
signingPrivateKeyPem: str,
CWlists: {}, listsEnabled: str) -> str:
"""Show the blogs timeline as html
@ -1542,7 +1542,7 @@ def htmlInboxBlogs(cssCache: {}, defaultTimeline: str,
authorized, None, theme, peertubeInstances,
allowLocalNetworkAccess, textModeBanner,
accessKeys, systemLanguage, maxLikeCount,
sharedItemsFederatedDomains, signingPrivateKeyPem,
shared_items_federated_domains, signingPrivateKeyPem,
CWlists, listsEnabled)
@ -1571,7 +1571,7 @@ def htmlInboxFeatures(cssCache: {}, defaultTimeline: str,
textModeBanner: str,
accessKeys: {}, systemLanguage: str,
maxLikeCount: int,
sharedItemsFederatedDomains: [],
shared_items_federated_domains: [],
signingPrivateKeyPem: str,
CWlists: {}, listsEnabled: str) -> str:
"""Show the features timeline as html
@ -1594,7 +1594,7 @@ def htmlInboxFeatures(cssCache: {}, defaultTimeline: str,
authorized, None, theme, peertubeInstances,
allowLocalNetworkAccess, textModeBanner,
accessKeys, systemLanguage, maxLikeCount,
sharedItemsFederatedDomains, signingPrivateKeyPem,
shared_items_federated_domains, signingPrivateKeyPem,
CWlists, listsEnabled)
@ -1622,7 +1622,7 @@ def htmlInboxNews(cssCache: {}, defaultTimeline: str,
textModeBanner: str,
accessKeys: {}, systemLanguage: str,
maxLikeCount: int,
sharedItemsFederatedDomains: [],
shared_items_federated_domains: [],
signingPrivateKeyPem: str,
CWlists: {}, listsEnabled: str) -> str:
"""Show the news timeline as html
@ -1645,7 +1645,7 @@ def htmlInboxNews(cssCache: {}, defaultTimeline: str,
authorized, None, theme, peertubeInstances,
allowLocalNetworkAccess, textModeBanner,
accessKeys, systemLanguage, maxLikeCount,
sharedItemsFederatedDomains, signingPrivateKeyPem,
shared_items_federated_domains, signingPrivateKeyPem,
CWlists, listsEnabled)
@ -1673,7 +1673,7 @@ def htmlOutbox(cssCache: {}, defaultTimeline: str,
textModeBanner: str,
accessKeys: {}, systemLanguage: str,
maxLikeCount: int,
sharedItemsFederatedDomains: [],
shared_items_federated_domains: [],
signingPrivateKeyPem: str,
CWlists: {}, listsEnabled: str) -> str:
"""Show the Outbox as html
@ -1698,5 +1698,5 @@ def htmlOutbox(cssCache: {}, defaultTimeline: str,
authorized, None, theme, peertubeInstances,
allowLocalNetworkAccess, textModeBanner,
accessKeys, systemLanguage, maxLikeCount,
sharedItemsFederatedDomains, signingPrivateKeyPem,
shared_items_federated_domains, signingPrivateKeyPem,
CWlists, listsEnabled)

View File

@ -347,7 +347,7 @@ def scheduledPostsExist(base_dir: str, nickname: str, domain: str) -> bool:
def sharesTimelineJson(actor: str, pageNumber: int, itemsPerPage: int,
base_dir: str, domain: str, nickname: str,
maxSharesPerAccount: int,
sharedItemsFederatedDomains: [],
shared_items_federated_domains: [],
sharesFileType: str) -> ({}, bool):
"""Get a page on the shared items timeline as json
maxSharesPerAccount helps to avoid one person dominating the timeline
@ -383,7 +383,7 @@ def sharesTimelineJson(actor: str, pageNumber: int, itemsPerPage: int,
if ctr >= maxSharesPerAccount:
break
break
if sharedItemsFederatedDomains:
if shared_items_federated_domains:
if sharesFileType == 'shares':
catalogsDir = base_dir + '/cache/catalogs'
else:
@ -396,7 +396,7 @@ def sharesTimelineJson(actor: str, pageNumber: int, itemsPerPage: int,
if not f.endswith('.' + sharesFileType + '.json'):
continue
federatedDomain = f.split('.')[0]
if federatedDomain not in sharedItemsFederatedDomains:
if federatedDomain not in shared_items_federated_domains:
continue
sharesFilename = catalogsDir + '/' + f
sharesJson = loadJson(sharesFilename)
@ -1495,7 +1495,7 @@ def htmlSearchResultShare(base_dir: str, sharedItem: {}, translate: {},
def htmlShowShare(base_dir: str, domain: str, nickname: str,
http_prefix: str, domainFull: str,
itemID: str, translate: {},
sharedItemsFederatedDomains: [],
shared_items_federated_domains: [],
defaultTimeline: str, theme: str,
sharesFileType: str, category: str) -> str:
"""Shows an individual shared item after selecting it from the left column
@ -1530,7 +1530,7 @@ def htmlShowShare(base_dir: str, domain: str, nickname: str,
if not f.endswith('.' + sharesFileType + '.json'):
continue
federatedDomain = f.split('.')[0]
if federatedDomain not in sharedItemsFederatedDomains:
if federatedDomain not in shared_items_federated_domains:
continue
sharesFilename = catalogsDir + '/' + f
sharesJson = loadJson(sharesFilename)