def main(argv): # if no arguments are provided, default to the GUI application if not argv: import lib.gui as gui from PyQt4 import QtGui app = QtGui.QApplication(sys.argv) window = gui.GUI() sys.exit(app.exec_()) # if user specifies CLI using the "--stream" argument, check if a port is also specified else: if argv[0] == '--stream': lsl = streamerlsl.StreamerLSL(GUI=False) else: try: if argv[1] != '--stream': print("Command '%s' not recognized" % argv[1]) return except IndexError: print("Command '%s' not recognized" % argv[0]) return port = argv[0] lsl = streamerlsl.StreamerLSL(port=port, GUI=False) lsl.create_lsl() #print("begin") lsl.begin()
try: log("Trying To Delete Database", xbmc.LOGNOTICE) xbmcvfs.delete(__cdam__.file_addon_db()) except StandardError, e: traceback.print_exc() log("# unable to remove folder", xbmc.LOGNOTICE) log("# Error: %s" % e.__class__.__name__, xbmc.LOGNOTICE) script_fail = True if not script_fail and not background_db: if rebuild: local_album_count, local_artist_count, local_cdart_count = cdam_db.refresh_db( True) elif not rebuild and not soft_exit: try: ui = gui.GUI("script-cdartmanager.xml", __cdam__.path()) xbmc.sleep(2000) ui.doModal() del ui clear_skin_properties() except KeyboardInterrupt: raise except Exception as e: log("Error in script occured", xbmc.LOGNOTICE) log(e.message, xbmc.LOGWARNING) traceback.print_exc() dialog_msg("close") clear_skin_properties() elif not background_db and not soft_exit: log("Problem accessing folder, exiting script", xbmc.LOGNOTICE)
import sys from urllib.parse import unquote_plus import xbmc import xbmcaddon LANGUAGE = xbmcaddon.Addon().getLocalizedString CWD = xbmcaddon.Addon().getAddonInfo('path') if (__name__ == '__main__'): try: params = dict(arg.split('=') for arg in sys.argv[ 1 ].split('&')) except: params = {} searchstring = unquote_plus(params.get('searchstring','')) if searchstring: del params['searchstring'] else: keyboard = xbmc.Keyboard('', LANGUAGE(32101), False) keyboard.doModal() if (keyboard.isConfirmed()): searchstring = keyboard.getText() if searchstring: from lib import gui ui = gui.GUI('script-globalsearch.xml', CWD, 'default', '1080i', True, searchstring=searchstring, params=params) ui.doModal() del ui
# * the Free Software Foundation; either version 2, or (at your option) # * any later version. # * # * This Program is distributed in the hope that it will be useful, # * but WITHOUT ANY WARRANTY; without even the implied warranty of # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # * GNU General Public License for more details. # * # * You should have received a copy of the GNU General Public License # * along with XBMC; see the file COPYING. If not, see # * <http://www.gnu.org/licenses/>. # * # */ import sys import xbmc import xbmcaddon ADDON = xbmcaddon.Addon() ADDONID = ADDON.getAddonInfo('id') CWD = ADDON.getAddonInfo('path') xbmc.log("%s: started" % (ADDONID), level=xbmc.LOGDEBUG) if (__name__ == "__main__"): from lib import gui ui = gui.GUI("%s.xml" % ADDONID.replace(".", "-"), CWD, "Default") ui.doModal() del ui sys.modules.clear()