mirror of
https://github.com/myned/modufur.git
synced 2024-12-24 14:27:27 +00:00
Changed formatter to use any order: tag
This commit is contained in:
parent
801ee2be71
commit
17b8ccb895
1 changed files with 29 additions and 29 deletions
|
@ -1,38 +1,38 @@
|
|||
def tostring(i, *, random=False):
|
||||
o = ''
|
||||
if i:
|
||||
for v in i:
|
||||
o += v + ' '
|
||||
o = o[:-1]
|
||||
elif random is True:
|
||||
o += 'order:random'
|
||||
else:
|
||||
o = ' '
|
||||
return o
|
||||
def tostring(i, *, order=None):
|
||||
o = ''
|
||||
if i:
|
||||
for v in i:
|
||||
o += v + ' '
|
||||
o = o[:-1]
|
||||
elif order:
|
||||
o += order
|
||||
else:
|
||||
o = ' '
|
||||
return o
|
||||
|
||||
|
||||
def tostring_commas(i):
|
||||
if i:
|
||||
o = ','
|
||||
for v in i:
|
||||
o += v + ','
|
||||
return o[:-1]
|
||||
return ''
|
||||
if i:
|
||||
o = ','
|
||||
for v in i:
|
||||
o += v + ','
|
||||
return o[:-1]
|
||||
return ''
|
||||
|
||||
|
||||
def dict_tostring(i):
|
||||
o = ''
|
||||
if i:
|
||||
for k, v in i.items():
|
||||
o += '**' + k + ':** `' + tostring(v) + '`\n'
|
||||
return o
|
||||
o = ''
|
||||
if i:
|
||||
for k, v in i.items():
|
||||
o += '**' + k + ':** `' + tostring(v) + '`\n'
|
||||
return o
|
||||
|
||||
|
||||
def dictelem_tostring(i):
|
||||
o = ''
|
||||
if i:
|
||||
for dic, elem in i.items():
|
||||
o += '**__' + dic + '__**\n'
|
||||
for k, v in elem.items():
|
||||
o += '***' + k + ':*** `' + tostring(v) + '`\n'
|
||||
return o
|
||||
o = ''
|
||||
if i:
|
||||
for dic, elem in i.items():
|
||||
o += '**__' + dic + '__**\n'
|
||||
for k, v in elem.items():
|
||||
o += '***' + k + ':*** `' + tostring(v) + '`\n'
|
||||
return o
|
||||
|
|
Loading…
Reference in a new issue