Skip to content

Commit

Permalink
more cleanup and cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
amet committed Apr 23, 2012
1 parent 67e2cde commit a1a4ba8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
9 changes: 0 additions & 9 deletions script.xbmc.subtitles/resources/lib/gui.py
Expand Up @@ -12,20 +12,11 @@

from utilities import *

STATUS_LABEL = 100
LOADING_IMAGE = 110
SUBTITLES_LIST = 120
SERVICES_LIST = 150
CANCEL_DIALOG = ( 9, 10, 92, 216, 247, 257, 275, 61467, 61448, )

_ = sys.modules[ "__main__" ].__language__
__scriptname__ = sys.modules[ "__main__" ].__scriptname__
__addon__ = sys.modules[ "__main__" ].__addon__
__cwd__ = sys.modules[ "__main__" ].__cwd__
__profile__ = sys.modules[ "__main__" ].__profile__

SERVICE_DIR = os.path.join(__cwd__, "resources", "lib", "services")

class GUI( xbmcgui.WindowXMLDialog ):

def __init__( self, *args, **kwargs ):
Expand Down
Expand Up @@ -7,6 +7,9 @@
import xbmc
import urllib

#_ = sys.modules[ "__main__" ].__language__


def search_subtitles( file_original_path, title, tvshow, year, season, episode, set_temp, rar, lang1, lang2, lang3, stack ): #standard input
ok = False
msg = ""
Expand Down
19 changes: 13 additions & 6 deletions script.xbmc.subtitles/resources/lib/utilities.py
Expand Up @@ -4,15 +4,22 @@
import re
import sys
import xbmc
import struct
import xbmcvfs
import shutil
import xbmcgui

__scriptname__ = sys.modules[ "__main__" ].__scriptname__
_ = sys.modules[ "__main__" ].__language__
__scriptname__ = sys.modules[ "__main__" ].__scriptname__
__cwd__ = sys.modules[ "__main__" ].__cwd__

STATUS_LABEL = 100
LOADING_IMAGE = 110
SUBTITLES_LIST = 120
SERVICES_LIST = 150
CANCEL_DIALOG = ( 9, 10, 92, 216, 247, 257, 275, 61467, 61448, )

SERVICE_DIR = os.path.join(__cwd__, "resources", "lib", "services")

LANGUAGES = (
LANGUAGES = (

# Full Language name[0] podnapisi[1] ISO 639-1[2] ISO 639-1 Code[3] Script Setting Language[4]

Expand Down Expand Up @@ -162,9 +169,9 @@ def rem_files(directory):
try:
for root, dirs, files in os.walk(directory, topdown=False):
for items in dirs:
shutil.rmtree(os.path.join(root, items), ignore_errors=True, onerror=None)
xbmcvfs.rmdir(os.path.join(root, items))
for name in files:
os.remove(os.path.join(root, name))
xbmcvfs.delete(os.path.join(root, name))
except:
pass

Expand Down

0 comments on commit a1a4ba8

Please sign in to comment.