Posts by KiddaC

    seagen did you have an attachment to this post originally.?

    Whats left on my never ending do to list....


    Finish my little plugin I am creating for jensen

    Try another attempt to get XStreamity downloader working for dreambox2.

    Amend jedi epg xtream to have a selectable folder address to work with that epg importer mod. grrr :pouting face:


    Try to continue with the update of new jedi. Although I got to read all the code again as I have paused for too long.

    Jedi EPG Xtream V2.05

    new files on post 1


    Updated sources

    Fixed a syntax error

    Changed the epg importer file names from jex.epg.channels.xml to jex.channels.xml


    I have left v2.04 on there to, if this doesn't work as expected. As its bed time . ZZzz..

    ** Note to any iptv providers. **


    I do not affilliate with any provider.


    I do not have any illegal content in any of my plugins.


    Monkey patching my plugins to be locked down to an iptv provider will result in me amending all my plugins to delete your rogue copy of my plugin.

    I have eyes and friends on most forums.


    Basically don't bother. It wastes my time and yours.

    The Zen of Python, by Tim Peters


    Beautiful is better than ugly.
    Explicit is better than implicit.
    Simple is better than complex.
    Complex is better than complicated.
    Flat is better than nested.
    Sparse is better than dense.
    Readability counts.
    Special cases aren't special enough to break the rules.
    Although practicality beats purity.
    Errors should never pass silently.
    Unless explicitly silenced.
    In the face of ambiguity, refuse the temptation to guess.
    There should be one-- and preferably only one --obvious way to do it.
    Although that way may not be obvious at first unless you're Dutch.
    Now is better than never.
    Although never is often better than *right* now.
    If the implementation is hard to explain, it's a bad idea.
    If the implementation is easy to explain, it may be a good idea.
    Namespaces are one honking great idea -- let's do more of those!


    7 Key Takeaways from the Zen of Python
    In this article, you'll take a look at the different rules of thumb posited by the Zen of Python, as well as how to implement them in your development workflow.
    initialcommit.com

    Common linting mistakes


    Start each python document with the following, just to be safe

    Python
    #!/usr/bin/python
    # -*- coding: utf-8 -*-
    blank line


    Lines too long - anything inside brackets can be split over multiple lines. Anything not in brackets can be split with \


    Modern python you should use spaces(4) and not tabs.


    Your code should have

    No space before a colon (:)

    test1: (correct)
    test2 : (incorrect)


    Space after a colon (:)

    test1: item (correct)

    test2:item (incorrect)


    Space after comma seperated items. i.e

    test1, test2 (correct

    test1,test2 (incorrect)


    Space around arithmetic operators.

    1 + 1 (correct)

    1+1 (incorrect)


    Comment should have a space after the #

    # correct

    #incorrect


    Inline comments should have 2 spaces before.


    some text  # inline comment correct

    some text # inline comment incorrect


    Check the indentation of your code. A good linting program will highlight indentation issues.

    Another reason why you should use 4 spaces instead. Tabs can do different things in different text editors.

    Dont mix tabs and spaces - this will not compile

    If it helps this is how I work.


    I have python 3 installed in my windows machine. I am currently using 3.10.

    This lives in my windows Program Files folder


    Download Python
    The official home of the Python Programming Language
    www.python.org


    I use Geany as my python text editor. (I find Visual Studio Community edition too bulky for python code. Notepad++ is not as good as Geany for python.)
    https://www.geany.org/download/releases/


    I have installed pylama as my python/geany linting program


    open a windows powershell (run as admin)

    use the command below to install pylama
    pip install pylama

    pasted-from-clipboard.png



    Then in Geany I have these settings. Build/Set build commands


    [Compile] python -m py_compile "%f"

    [Full lint] pylama --max-line-length=800 --ignore=E722,W605,C901 "%f"


    pasted-from-clipboard.png


    Now on my setup

    clicking compile will highlight any code errors.

    clicking f9 - will do a full lint - and highlight anything else that needs amending

    pasted-from-clipboard.png


    Other useful commands in Geany

    pasted-from-clipboard.png


    For your home setup you would also have to install any common python libraries you use i.e requests using the "pip install ...." command in windows powershell

    Just search https://pypi.org/ for the library and pip command

    As I often get asked by other coders and plugin developers to check their code as its not working and they don't know why.
    Basically I go through the same motions every time which usually highlights their errors.


    Which is basically load it in my software. Look for any compile errors. Look for any Linting errors.
    Fix those errors and warning, then everything usually works.

    Sometimes its not that simple and requires a full debug, but most of the time it is that simple error that is breaking things.