mirror of https://gitlab.com/bashrc2/epicyon
Add shares to test data
parent
b0da9c8b72
commit
454d02bc89
21
epicyon.py
21
epicyon.py
|
@ -74,6 +74,7 @@ from manualapprove import manualDenyFollowRequest
|
|||
from manualapprove import manualApproveFollowRequest
|
||||
from shares import sendShareViaServer
|
||||
from shares import sendUndoShareViaServer
|
||||
from shares import addShare
|
||||
import argparse
|
||||
|
||||
def str2bool(v):
|
||||
|
@ -1152,6 +1153,26 @@ if args.testdata:
|
|||
setRole(baseDir,nickname,domain,'epicyon','hacker')
|
||||
setRole(baseDir,nickname,domain,'someproject','assistant')
|
||||
setAvailability(baseDir,nickname,domain,'busy')
|
||||
|
||||
addShare(baseDir,nickname,domain, \
|
||||
"spanner", \
|
||||
"It's a spanner", \
|
||||
"img/shares1.png", \
|
||||
"tool", \
|
||||
"mechanical", \
|
||||
"City", \
|
||||
"2 months",
|
||||
debug)
|
||||
addShare(baseDir,nickname,domain, \
|
||||
"witch hat", \
|
||||
"Spooky", \
|
||||
"img/shares2.png", \
|
||||
"hat", \
|
||||
"clothing", \
|
||||
"City", \
|
||||
"3 months",
|
||||
debug)
|
||||
|
||||
deleteAllPosts(baseDir,nickname,domain,'inbox')
|
||||
deleteAllPosts(baseDir,nickname,domain,'outbox')
|
||||
createPublicPost(baseDir,nickname,domain,port,httpPrefix,"like, this is totally just a test, man",False,True,False,None,None,useBlurhash)
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 39 KiB |
Binary file not shown.
After Width: | Height: | Size: 27 KiB |
|
@ -102,19 +102,19 @@ def addShare(baseDir: str,nickname: str,domain: str, \
|
|||
if not os.path.isdir(baseDir+'/sharefiles'):
|
||||
os.mkdir(baseDir+'/sharefiles')
|
||||
itemIDfile=baseDir+'/sharefiles/'+str(published)+itemID
|
||||
if imageFilename.endswidth('.png'):
|
||||
if imageFilename.endswith('.png'):
|
||||
if moveImage:
|
||||
os.rename(imageFilename,itemIDfile+'.png')
|
||||
else:
|
||||
copyfile(imageFilename,itemIDfile+'.png')
|
||||
imageUrl='/sharefiles/'+str(published)+itemID+'.png'
|
||||
if imageFilename.endswidth('.jpg'):
|
||||
if imageFilename.endswith('.jpg'):
|
||||
if moveImage:
|
||||
os.rename(imageFilename,itemIDfile+'.jpg')
|
||||
else:
|
||||
copyfile(imageFilename,itemIDfile+'.jpg')
|
||||
imageUrl='/sharefiles/'+str(published)+itemID+'.jpg'
|
||||
if imageFilename.endswidth('.gif'):
|
||||
if imageFilename.endswith('.gif'):
|
||||
if moveImage:
|
||||
os.rename(imageFilename,itemIDfile+'.gif')
|
||||
else:
|
||||
|
@ -126,7 +126,7 @@ def addShare(baseDir: str,nickname: str,domain: str, \
|
|||
"summary": summary,
|
||||
"imageUrl": imageUrl,
|
||||
"itemType": itemType,
|
||||
"category": category,
|
||||
"category": itemCategory,
|
||||
"location": location,
|
||||
"published": published,
|
||||
"expire": durationSec
|
||||
|
|
Loading…
Reference in New Issue