コード例 #1
0
# -*- coding: utf-8 -*-
import sys, os
from feedreader.opml import OpmlFile
from feedreader.archivefile import ArchiveFile
#!This script is called by batch - not by xbmc!#

DIR_HOME = sys.argv[1]

DIR_ARCHIVES = os.path.join(DIR_HOME, 'archives')
if not os.path.exists(DIR_ARCHIVES):
    os.mkdir(DIR_ARCHIVES)
ArchiveFile.setArchivePath(DIR_ARCHIVES)


class ConsoleGui(object):
    @staticmethod
    def log(message):
        print message


try:
    PATH_FILE_OPML = sys.argv[2]
except IndexError:
    PATH_FILE_OPML = ""

if (PATH_FILE_OPML == ""):
    PATH_FILE_OPML = os.path.join(DIR_HOME, "opml.xml")

opmlFile = OpmlFile(PATH_FILE_OPML, DIR_HOME, ConsoleGui())
opmlFile.load()
コード例 #2
0
# -*- coding: utf-8 -*-
import sys,os
from feedreader.opml import OpmlFile
from feedreader.archivefile import ArchiveFile
#!This script is called by batch - not by xbmc!#


DIR_HOME = sys.argv[1];

DIR_ARCHIVES = os.path.join(DIR_HOME, 'archives')
if not os.path.exists(DIR_ARCHIVES):
  os.mkdir(DIR_ARCHIVES);
ArchiveFile.setArchivePath(DIR_ARCHIVES);

class ConsoleGui(object):
  @staticmethod
  def log(message):
    print message;
try:
  PATH_FILE_OPML = sys.argv[2];
except IndexError:
  PATH_FILE_OPML = "";

if (PATH_FILE_OPML == ""):
  PATH_FILE_OPML = os.path.join(DIR_HOME,"opml.xml");

opmlFile = OpmlFile(PATH_FILE_OPML, DIR_HOME, ConsoleGui());
opmlFile.load();
コード例 #3
0
ファイル: default.py プロジェクト: raptor2101/PodCatcher
  os.mkdir(DIR_HOME);

DIR_ARCHIVES = os.path.join(DIR_HOME, 'archives')
if not os.path.exists(DIR_ARCHIVES):
  os.mkdir(DIR_ARCHIVES);
ArchiveFile.setArchivePath(DIR_ARCHIVES);


PATH_FILE_OPML = __settings__.getSetting("opmlFile")
if (PATH_FILE_OPML == ""):
  PATH_FILE_OPML = os.path.join(DIR_HOME,"opml.xml");
if not os.path.exists(PATH_FILE_OPML):
  gui.errorOK(__language__(30040),__language__(30041));
else:
  gui.log(PATH_FILE_OPML)
  opmlFile = OpmlFile(PATH_FILE_OPML, DIR_HOME, gui);

  if not path:
    path = ""
    action = "browse"

  gui.log("Path: "+path);
  gui.log("Action: "+action);

  if(len(path) > 0):
    path = path.split('.');
  else:
    path = [];

  if(action == "play" or action == "markRead" or action == "reload"):
    if action == "play":
コード例 #4
0
if not os.path.exists(DIR_HOME):
    os.mkdir(DIR_HOME)

DIR_ARCHIVES = os.path.join(DIR_HOME, 'archives')
if not os.path.exists(DIR_ARCHIVES):
    os.mkdir(DIR_ARCHIVES)
ArchiveFile.setArchivePath(DIR_ARCHIVES)

PATH_FILE_OPML = __settings__.getSetting("opmlFile")
if (PATH_FILE_OPML == ""):
    PATH_FILE_OPML = os.path.join(DIR_HOME, "opml.xml")
if not os.path.exists(PATH_FILE_OPML):
    gui.errorOK(__language__(30040), __language__(30041))
else:
    gui.log(PATH_FILE_OPML)
    opmlFile = OpmlFile(PATH_FILE_OPML, DIR_HOME, gui)

    if not path:
        path = ""
        action = "browse"

    gui.log("Path: " + path)
    gui.log("Action: " + action)

    if (len(path) > 0):
        path = path.split('.')
    else:
        path = []

    if (action == "play" or action == "markRead" or action == "reload"):
        if action == "play":