~ausimage/soovee/trunk

« back to all changes in this revision

Viewing changes to soovee_app/cli/feed.py

  • Committer: Jeremy AustinBardo
  • Date: 2009-06-11 01:31:26 UTC
  • Revision ID: tjaustinbardo@gmail.com-20090611013126-0g4axgnvbif9y3og
Fix bugs with shelf creation and stray copy paste errors. Adjusted epydoc comments to more

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
SooVee Serial Audio Manager - Feed support module for the command interface. It 
20
20
manages or formats serial audio feeds from a service.
21
21
 
22
 
    - C{update(opmlpath:str) -> None}
23
 
    - C{format(opmlpath:str, directory:str, format:str) -> None}
24
 
    - C{manage(action:str, idnum:int) -> None}
 
22
    - C{update(opml:str, cache:obj, service:obj) -> None}
 
23
    - C{compose(opml:str, directory:str, form:str, cache:obj, service:obj): 
 
24
        -> None}
 
25
    - C{manage(action:str, idnum:int, cache:obj, service:obj) -> None}
25
26
    
26
 
@requires: L{soovee_lib.sv_data}
27
 
@requires: L{soovee_app.cli.main}
28
 
@requires: L{soovee_app.lib.sv_check}
 
27
@requires: L{soovee_lib.ckuri}
29
28
@requires: L{soovee_app.forms}
30
 
@requires: L{soovee_lib.sv_query}
 
29
@requires: L{soovee_lib.parse}
 
30
@requires: L{soovee_lib.mkuri}
31
31
"""
32
32
 
33
33
#
39
39
    update each unfinished Rss feed subscribed by this account. Currently, feeds
40
40
    that contain an episode description of 'The End' are considered complete.
41
41
 
42
 
    @param opmlpath: Url path to Opml file for the account.
43
 
    @type opmlpath: basestring
 
42
    @param opml: Url path to Opml file for the account.
 
43
    @type opml: basestring
 
44
    @param cache: Intialized soovee.lib.sv_read object. Default None.
 
45
    @type cache: obj
 
46
    @param service: Intialized soovee.regex object. Default None.
 
47
    @type service: obj
44
48
    @return:
45
49
    @rtype: None
46
 
    @requires: L{soovee_lib.sv_check}
 
50
    @requires: L{soovee_lib.ckuri}
47
51
    """
48
52
    from soovee_lib.ckuri import Refresh #: Feed update module
49
53
 
63
67
    Format serial audio feeds for a service account. Load and parse serial audio
64
68
    feeds before using the option selected with the forms module.
65
69
 
66
 
    @param opmlpath: Url path to Opml file for the account.
67
 
    @type opmlpath: basestring
 
70
    @param opml: Url path to Opml file for the account.
 
71
    @type opml: basestring
68
72
    @param directory: Directory to save new page format.
69
73
    @type directory: basestring
70
 
    @param format: soovee.forms module option.
71
 
    @type format: basestring
 
74
    @param form: soovee.forms module option.
 
75
    @type form: basestring
 
76
    @param cache: Intialized soovee.lib.sv_read object. Default None.
 
77
    @type cache: obj
 
78
    @param service: Intialized soovee.regex object. Default None.
 
79
    @type service: obj
72
80
    @return:
73
81
    @rtype: None
74
 
    @requires: L{soovee.forms}
 
82
    @requires: L{soovee_app.forms}
 
83
    @requires: L{soovee_lib.parse}
75
84
    """
76
85
    from ..forms import FORMS as Forms #: Forms package with format plugins
77
 
    from soovee_lib.sv_parse import Xml #: Opml / Rss data parsers.
 
86
    from soovee_lib.parse import Xml #: Opml / Rss data parsers.
78
87
    try: 
79
88
        #{ Set Forms Composer
80
89
        composer = Forms.get(command=form)
112
121
    @type action: basestring
113
122
    @param idnum: service id for a selected feed.
114
123
    @type idnum: int
 
124
    @param cache: Intialized soovee.lib.sv_read object. Default None.
 
125
    @type cache: obj
 
126
    @param service: Intialized soovee.regex object. Default None.
 
127
    @type service: obj
115
128
    @return:
116
129
    @rtype: None
117
130
    @note: WRT Podiobooks [del|one|all] use one id and [add] a different id.
118
 
    @requires: L{soovee.lib.sv_query}
 
131
    @requires: L{soovee_lib.mkuri}
119
132
    """
120
133
    from soovee_lib.mkuri import mkquery
121
134
    try:
122
 
        cache.Cache(mkquery(service, action, idnum.strip()), update=True):
 
135
        cache.Cache(mkquery(service, action, idnum.strip()), update=True)
123
136
        print("Serial audio subscription for %s were %s." % (idnum,
124
137
            "Updated" if action in ['add','del'] else "Released"))
125
138