Total Revolution Management Console - sign up for a free trial today.

TRMC


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Suggestions / New Updates
#1
I'll update this whenever a new bug fix / update / addition has been added to the Python Koding framework.

If you have any suggestions of what you'd like to see added feel free to post up details in here.

Do
not ask for code to be added for scraping websites or resolving videos. Although I'm happy to add a few video based features if they aren't already natively available in Kodi it's not something that really interests me. There's already plenty of others out there focusing on video content so I aim to continue focusing on improving the other aspects of Kodi.
Reply
#2
v.0.9.9.1.2:

Added Remove_Formatting() function:
Found in the vartools.py file this will cleanup a Kodi string. It can remove color, bold and italic tags as well as preceding spaces, dots and dashes. Particularly useful if you want to show the names of add-ons in alphabetical order where add-on names have deliberately had certain formatting added to them to get them to always show at the top of lists.

CODE: Remove_Formatting(string, [color, bold, italic, spaces, dots, dashes])

AVAILABLE PARAMS:
  • (*) string  -  This is string you want to remove formatting from.
  • color  -  By default this is set to true and all references to the color tag will be removed, set this to false if you don't want color formatting removed
  • bold  -  By default this is set to true and all references to the bold tag will be removed, set this to false if you don't want bold formatting removed.
  • italic  -  By default this is set to true and all references to the italic tag will be removed, set this to false if you don't want italic formatting removed.
  • spaces  -  By default this is set to true and any spaces at the start of the text  will be removed, set this to false if you don't want the spaces removed
  • dots  -  By default this is set to true and any dots (.) at the start of the text will be removed, set this to false if you don't want the dots removed.
  • dashes  -  By default this is set to true and any dashes (-) at the start of the text will be removed, set this to false if you don't want the dashes removed.
EXAMPLE CODE:
Code:
dialog = xbmcgui.Dialog()
mystring = '...-- [I]This[/I]  is the [COLOR dodgerblue]ORIGINAL[/COLOR] [B][COLOR cyan]TEXT[/COLOR][/B]'

dialog.ok('[COLOR gold]ORIGINAL TEXT[/COLOR]','Below is the original text we\'re going to try and clean up:[CR]%s'%mystring)

dialog.ok('[COLOR gold]DOTS REMOVED[/COLOR]','[COLOR gold]Original:[/COLOR][CR]%s[CR][COLOR gold]This is with only dots set to True:[/COLOR][CR]%s'%(mystring,koding.Remove_Formatting(mystring, color=False, bold=False, italic=False, spaces=False, dots=True, dashes=False)))

dialog.ok('[COLOR gold]DOTS & DASHES REMOVED[/COLOR]','[COLOR gold]Original:[/COLOR][CR]%s[CR][COLOR gold]This is with dots & dashes set to True:[/COLOR][CR]%s'%(mystring,koding.Remove_Formatting(mystring, color=False, bold=False, italic=False, spaces=False, dots=True, dashes=True)))

dialog.ok('[COLOR gold]DOTS, DASHES & SPACES REMOVED[/COLOR]','[COLOR gold]Original:[/COLOR][CR]%s[CR][COLOR gold]This is with dots, dashes & spaces set to True:[/COLOR][CR]%s'%(mystring,koding.Remove_Formatting(mystring, color=False, bold=False, italic=False, spaces=True, dots=True, dashes=True)))

dialog.ok('[COLOR gold]ALL FORMATTING REMOVED[/COLOR]','[COLOR gold]Original:[/COLOR][CR]%s[CR][COLOR gold]This is with all options set to True:[/COLOR][CR]%s'%(mystring,koding.Remove_Formatting(mystring)))
Reply
#3
(12-07-2017, 01:42 PM)trevdev Wrote: I'll update this whenever a new bug fix / update / addition has been added to the Python Koding framework.

If you have any suggestions of what you'd like to see added feel free to post up details in here.

Do
not ask for code to be added for scraping websites or resolving videos. Although I'm happy to add a few video based features if they aren't already natively available in Kodi it's not something that really interests me. There's already plenty of others out there focusing on video content so I aim to continue focusing on improving the other aspects of Kodi.


No loss, if you ask me! I have no interest in doing what a million others ave done before, as u well know, I'd rather pursue new ideas....


Sent from my iPhone using Tapatalk
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)