Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: CI

on:
push:
branches-ignore:
- "master"
- "releases/**"

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9']
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: install
run: |
pip install -r requirements.txt

- name: test
run: |
pytest
- name: createcoverage
run: |
pytest --cov=plugin.program.autowidget
# - name: Coveralls
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
- name: make package
run: |
sed -i "s/name=\"AutoWidget\" version=\"CURRENT_VERSION\"/name=\"AutoWidget\" version=\"${CIRCLE_TAG-0.0.$CIRCLE_BUILD_NUM}\"/" ./plugin.program.autowidget/addon.xml
zip -Xr /tmp/plugin.program.autowidget.zip plugin.program.autowidget
# - store_artifacts:
# path: /tmp/plugin.program.autowidget.zip
# - persist_to_workspace:
# root: /tmp
# paths:
# - plugin.program.autowidget.zip


# circle ci config

# jobs:
# build:
# docker:
# - image: circleci/python:2
# steps:
# - checkout
# release:
# parameters:
# commit_branch:
# type: string
# default: repo
# overwrite:
# type: boolean
# default: false
# docker:
# - image: circleci/python:2
# steps:
# - attach_workspace:
# at: /tmp
# - checkout
# - run: |
# git checkout << parameters.commit_branch >>
# python create_repository.py -d ./zips /tmp/plugin.program.autowidget.zip
# find ./zips -name "*.zip" | xargs python create_repository.py -d ./zips
# - unless:
# condition: << parameters.overwrite >>
# steps:
# run: git ls-files -m ./zips/|grep -v ".zip"
# - run: |
# git add ./zips
# git commit -m "Release version ${CIRCLE_TAG-0.0.$CIRCLE_BUILD_NUM}"
# git push
# workflows:
# version: 2
# build_and_release:
# jobs:
# - build:
# filters:
# tags:
# only: /.*/
# branches:
# ignore:
# - repo
# - devrepo
# - release:
# context: publish
# requires:
# - build
# filters:
# branches:
# ignore: /.*/
# tags:
# only: /.*/
# - release:
# commit_branch: devrepo
# overwrite: true
# context: publish
# requires:
# - build
# filters:
# branches:
# ignore:
# - devrepo
# - master
# - repo
32 changes: 16 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
*.pyc
*.pyo
.DS*
.pylint_rc
/.idea
/.project
/.pydevproject
/.settings
Thumbs.db
*~
.cache
lib
bin
.venv
.vscode
venv/
*.pyc
*.pyo
.DS*
.pylint_rc
/.idea
/.project
/.pydevproject
/.settings
Thumbs.db
*~
.cache
lib
bin
.venv
.vscode
venv/
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ msgstr ""
"Language: en\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#This is a comment

msgctxt "#32000"
msgid "General"
msgstr ""
Expand Down Expand Up @@ -95,7 +93,7 @@ msgid "Create a new group of shortcuts."
msgstr ""

msgctxt "#32019"
msgid "View the "{}" group."
msgid "View the \"{}\" group."
msgstr ""

msgctxt "#32020"
Expand Down Expand Up @@ -563,7 +561,7 @@ msgid "Predefined Color"
msgstr ""

msgctxt "#32136"
msgid "Hex codes must be of the format "#RRGGBB"."
msgid "Hex codes must be of the format \"#RRGGBB\"."
msgstr ""

msgctxt "#32137"
Expand Down
5 changes: 3 additions & 2 deletions plugin.program.autowidget/resources/lib/common/directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import six

from resources.lib.common import utils
from resources.lib import common

try:
from urllib.parse import urlencode
Expand Down Expand Up @@ -60,8 +61,8 @@ def add_sort_methods(handle):

def add_menu_item(title, params=None, path=None, info=None, cm=None, art=None,
isFolder=False, props=None):
_plugin = sys.argv[0]
_handle = int(sys.argv[1])
_plugin = common.dispatched_plugin
_handle = common.dispatched_handle


if params is not None:
Expand Down
4 changes: 4 additions & 0 deletions plugin.program.autowidget/resources/lib/common/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from resources.lib import refresh
from resources.lib.common import directory
from resources.lib.common import utils
from resources.lib import common


def _log_params(_plugin, _handle, _params):
Expand All @@ -27,6 +28,9 @@ def _log_params(_plugin, _handle, _params):


def dispatch(_plugin, _handle, _params):
common.dispatched_plugin = _plugin
common.dispatched_handle = _handle

params = _log_params(_plugin, int(_handle), _params)
category = 'AutoWidget'
is_dir = False
Expand Down
6 changes: 3 additions & 3 deletions plugin.program.autowidget/resources/lib/common/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from kodi_six import xbmc
from kodi_six import xbmcaddon
from kodi_six import xbmcgui
import xbmc
import xbmcaddon
import xbmcgui

import codecs
import contextlib
Expand Down
4 changes: 2 additions & 2 deletions plugin.program.autowidget/resources/lib/menu.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from kodi_six import xbmcgui
import xbmcgui

import re
import uuid
Expand Down Expand Up @@ -313,7 +313,7 @@ def show_path(group_id, path_label, widget_id, path, idx=0, titles=None, num=1,

directory.add_menu_item(title=title[0],
path=file['file'],
art=file['art'],
art=file.get('art',{}),
info=file,
isFolder=file['filetype'] == 'directory',
props=properties)
Expand Down
6 changes: 3 additions & 3 deletions plugin.program.autowidget/resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@

<!-- Backup/Restore -->
<setting label="$ADDON[plugin.program.autowidget 32090]" type="lsep" />
<setting label="$ADDON[plugin.program.autowidget 32091]" type="action" id="backup.location" action="RunPlugin(plugin://plugin.program.autowidget/?mode=backup&action=location)" default="special://userdata/addon_data/plugin.program.autowidget/backups/" />
<setting label="$ADDON[plugin.program.autowidget 32092]" type="action" action="RunPlugin(plugin://plugin.program.autowidget/?mode=backup&action=backup)" option="close" />
<setting label="$ADDON[plugin.program.autowidget 32093]" type="action" action="RunPlugin(plugin://plugin.program.autowidget/?mode=backup&action=restore)" option="close" />
<setting label="$ADDON[plugin.program.autowidget 32091]" type="action" id="backup.location" action="RunPlugin(plugin://plugin.program.autowidget/?mode=backup&amp;action=location)" default="special://userdata/addon_data/plugin.program.autowidget/backups/" />
<setting label="$ADDON[plugin.program.autowidget 32092]" type="action" action="RunPlugin(plugin://plugin.program.autowidget/?mode=backup&amp;action=backup)" option="close" />
<setting label="$ADDON[plugin.program.autowidget 32093]" type="action" action="RunPlugin(plugin://plugin.program.autowidget/?mode=backup&amp;action=restore)" option="close" />
</category>
</settings>

5 changes: 5 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[pytest]
addopts = --doctest-modules
doctest_optionflags = NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL ELLIPSIS
python_files = test_*.py tests.py
testpaths = tests
27 changes: 27 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
certifi==2020.4.5.1
chardet==3.0.4
idna==2.9
requests==2.23.0
urllib3==1.25.9
pytz
polib~=1.1.0
future~=0.17.1
bs4
pytest
vcrpy
pylint
coverage
flake8
flake8-docstrings
parameterized
darglint; python_version>"3.5"
kodistubs==18.0.0; python_version<"3.7"
kodistubs==19.0.1; python_version>="3.7"
contextlib2; python_version<"3"
requests-mock
Mock
tzlocal
Pillow
pytest
pytest-cov
coveralls
Loading