Skip to content

Commit

Permalink
All string literals are Unicode by default.
Browse files Browse the repository at this point in the history
Also, change all IO functions to handle Unicode. All strings returned by Kodi are decoded from UTF-8 into Unicode.
  • Loading branch information
Wintermute0110 committed Aug 17, 2016
1 parent 9392e0f commit 0d927b6
Show file tree
Hide file tree
Showing 14 changed files with 381 additions and 357 deletions.
2 changes: 2 additions & 0 deletions addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# --- Python standard library ---
from __future__ import unicode_literals

# --- Modules/packages in this plugin ---
import resources.main
Expand Down
1 change: 1 addition & 0 deletions resources/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# GNU General Public License for more details.

# --- Python standard library ---
from __future__ import unicode_literals
import os

# --- AEL packages ---
Expand Down
184 changes: 107 additions & 77 deletions resources/disk_IO.py

Large diffs are not rendered by default.

509 changes: 236 additions & 273 deletions resources/main.py

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion resources/net_IO.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# Python standard library
# --- Python standard library ---
from __future__ import unicode_literals
import sys, random, urllib2

# AEL packages
Expand Down
3 changes: 3 additions & 0 deletions resources/scrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# --- Python standard library ---
from __future__ import unicode_literals

# -------------------------------------------------------------------------------------------------
# We support online an offline scrapers.
# Note that this module does not depend on Kodi stuff at all, and can be
Expand Down
3 changes: 3 additions & 0 deletions resources/scrap_asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# --- Python standard library ---
from __future__ import unicode_literals
import sys, urllib, urllib2, re

# --- AEL modules ---
from scrap import *
from scrap_info import *

Expand Down
3 changes: 3 additions & 0 deletions resources/scrap_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# --- Python standard library ---
from __future__ import unicode_literals
import sys, urllib, urllib2, re

# --- AEL modules ---
from scrap import *
from scrap_info import *
from net_IO import *
Expand Down
4 changes: 4 additions & 0 deletions resources/scrap_fanart.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# --- Python standard library ---
from __future__ import unicode_literals

# --- AEL modules ---
from scrap import *

# -----------------------------------------------------------------------------
Expand Down
3 changes: 3 additions & 0 deletions resources/scrap_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# --- Python standard library ---
from __future__ import unicode_literals

# -----------------------------------------------------------------------------
# Miscellaneous emulator and gamesys (platforms) supported.
# -----------------------------------------------------------------------------
Expand Down
8 changes: 3 additions & 5 deletions resources/scrap_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# -----------------------------------------------------------------------------
# We support online an offline scrapers.
# Note that this module does not depend on Kodi stuff at all, and can be
# called externally from console Python scripts for testing of the scrapers.
# -----------------------------------------------------------------------------
# --- Python standard library ---
from __future__ import unicode_literals

# --- AEL modules ---
from scrap import *
from scrap_common import *
from disk_IO import *
Expand Down
5 changes: 5 additions & 0 deletions resources/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
#
# Utility functions which does not depend on Kodi modules (except log_* functions)
#

# --- Python standard library ---
from __future__ import unicode_literals
import sys, os, shutil, time, random, hashlib, urlparse, re, string

# --- AEL modules ---
try:
from utils_kodi import *
except:
Expand Down
7 changes: 6 additions & 1 deletion resources/utils_kodi.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@
#
# Utility functions which DEPEND on Kodi modules
#

# --- Python standard library ---
from __future__ import unicode_literals
import sys, os, shutil, time, random, hashlib, urlparse

# --- Kodi modules ---
import xbmc, xbmcgui

# Addon custom modules/packages
# --- AEL modules ---
import utils
import disk_IO

Expand Down
3 changes: 3 additions & 0 deletions resources/utils_kodi_standalone.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
# outside Kodi in standard Python.
#

# --- Python standard library ---
from __future__ import unicode_literals

def log_debug(str):
print(str)

Expand Down

0 comments on commit 0d927b6

Please sign in to comment.