Guido Draheim avatar Guido Draheim committed d83fbbf Merge

0.4.14

Comments (0)

Files changed (8)

src/TODO.txt

-* clear bug on recordinglist (non-latin chars?)
-* fallback für recordinguser sollte "wwwrun" sein
-  oder was immer gerade als prozess läuft, damit
-  auch gelöscht werden kann.
-  

src/dvbcronrecording/channels.py

       Returns list of the channels
     """
     def _channel_list(self, cursor, req):
-        return channel_list(cursor, req.args)
+        return channel_list(cursor) # no req.args here
 
     """
       Appends a new entry into channel list

src/dvbcronrecording/channelsconf.de.po

 "Plural-Forms: nplurals=3; plural=(n==0 ? 0 : (n == 1 ? 1 : 2));\n"
 
 msgid "insert"
-msgstr "einfuegen"
+msgstr "einfügen"
 
 msgid "delete"
-msgstr "loeschen"
+msgstr "löchen"
 
 msgid "update"
 msgstr "aktualisieren"
 
 msgid "takeover"
-msgstr "uebernehmen"
+msgstr "übernehmen"
 
 msgid "play"
 msgstr "Abspielen"

src/dvbcronrecording/channelsconf.py

             add_stylesheet(req, PACKAGE+'/css/recordingchannelsconf.css')
             add_script(req, 'common/js/trac.js')
             return ('channelsconf_take.html', data, None)
-            
+        
+        channeltype = ""
+        if page in [ 'show']:
+            channeltype = "video channels"
+        if page in [ "list/video" ]:
+            channeltype = "video channels"
+        if page in [ "list/radio" ]:
+            channeltype = "radio channels"
+        if req.args.has_key("channeltype"):
+            channeltype = req.args["channeltype"]
+        if not channeltype:
+            channeltype = "all channel types"
         
         # ------------------------------------------------
         message = ""
         
-        if page in [ 'show']:
-            for col in ['apid', 'vpid']:
-                req.args[col+"notnull"] = u"checked"
-            message = translate("have checked it!") + req.args["vpidnotnull"] + " " + str(req.args.has_key("vpidnotnull"))
-        else:
-            message = translate("have NOT checked it!")
-        if page in [ None, '', 'list' ]:
-            pass
         if page in [ 'newentry', 'append' ]:
             message = self._channelsconf_append(cursor, req)
         if page in [ 'update' ]:
         add_script(req, 'common/js/wikitoolbar.js')
         
         if not message: message = translate("please do not use umlauts")
-        message += translate("?problem")
+        # message += translate("?problem")
+        message += "[%s]" % channeltype
+        message += "{%s}" % page
         
         newchannels_list = self._newchannels_list(cursor, req)
-        channels_list = self._channelsconf_list(cursor, req)
+        channels_list = self._channelsconf_list(cursor, req, channeltype)
+        channeltypelist = ["all channel types",
+                           "data channels", 
+                           "radio channels", 
+                           "video channels"]
 
         # passing variables to template
         data = {}
         data['title'] = translate('Channel List')
         data['polaritylist'] = polaritylist
         data['adapterlist'] = self._adapter_list(cursor, req)
+        data["channeltype"] = channeltype
+        data["channeltypelist"] = channeltypelist
         data['new_datalist'] = newchannels_list
+        data['_selection'] = "channeltype="+quote2(channeltype)
         data["_pagenum"] = req.args.get("_pagenum", "0")
         data["_pagesize"] = req.args.get("_pagesize", "10")
         data['datalist'] = Paginator(channels_list, int(data["_pagenum"]), int(data["_pagesize"]))
     """
       Returns list of the channels.conf
     """
-    def _channelsconf_list(self, cursor, req):
-        notnull = ['apid', 'vpid']
+    def _channelsconf_list(self, cursor, req, channeltype = None):
         view = ['adapter']
         cols = ['adapter', 'title','frequency','polarity','source','symbolrate','vpid', 'apid', 'tpid']
         sql = "SELECT %s FROM recording_channelsconf" % (",".join(cols))
         order_sql = " ORDER BY title, adapter, source"
-        notnull_cols = []
-        for col in notnull:
-            if req.args.has_key(col+"notnull") and req.args[col+"notnull"]:
-                notnull_cols += [ col ]
         view_vals = []
         view_cols = []
+        type_cols = []
         for col in view:
             if req.args.has_key(col):
                 view_vals += [ aff(req.args[col], "recording_channelsconf", col) ]
                 view_cols += [ col ]
+        if channeltype in [ "audio", "video", "radio channels", "video channels" ]:
+            type_cols += ["apid > 0"]
+        elif channeltype in [ "data", "data channels"]:
+            type_cols += ["apid = 0"]
+        if channeltype in [ "video", "video channels" ]:
+            type_cols += ["vpid > 0"]
+        elif channeltype in [ "audio", "radio channels"]:
+            type_cols += ["vpid = 0"]
         if view_cols:
             view_sql = " WHERE " + (" AND ".join([" %s = %%s" % col for col in view_cols ]))
-            if notnull_cols:
-                view_sql += " AND "+ (" AND ".join([" %s > 0" % col for col in notnull_cols ])) 
+            if type_cols:
+                view_sql += " AND " + " AND ".join(type_cols)
             logg.info("sql = %s", sql + view_sql)
             cursor.execute(sql + view_sql + order_sql, view_vals)
         else:
             view_sql = ""
-            if notnull_cols:
-                view_sql += " WHERE "+ (" AND ".join([" %s > 0" % col for col in notnull_cols ])) 
+            if type_cols:
+                view_sql += " WHERE " + " AND ".join(type_cols)
             logg.info("sql = %s;", sql + order_sql)
             cursor.execute(sql + view_sql + order_sql)
         entries = []

src/dvbcronrecording/messages.de.po

 msgstr[0] "keine Einträge"
 msgstr[1] "%(n)s Eintrag"
 msgstr[2] "%(n)s Einträge"
+
+msgid "channel type"
+msgstr "Kanaltyp"
+
+msgid "video channels"
+msgstr "Fernsehkanäle"
+
+msgid "radio channels"
+msgstr "Radiokanäle"
+
+msgid "data channels"
+msgstr "Datenkanäle"
+
+msgid "all channel types"
+msgstr "Alle Sendekanäle"
+
+msgid "channel subselection"
+msgstr "Teilauswahl Kanäle"
+ 
+msgid "channels.conf editor"
+msgstr "channels.conf Editor"

src/dvbcronrecording/templates/channelsconf_list.html

   <xi:include href="channels_nav.html" />
   <xi:include href="channelsconf_nav.html" />
   <div class="actionlist">
+                  &nbsp; &nbsp; &nbsp; &nbsp;
           <form method="get" action="${href.recording('channelsconf/list')}" class="actionform">
-            <input type="submit" value="${_('channel.conf list')}" class="actionbutton"></input>
             <select name="adapter">
                 <option py:for="adapter in sorted(adapterlist)" 
                         value="${adapter}">
                         ${adapter}
                 </option>
             </select>
-            <label for="vpidnotnull">${_("vpid")} &gt; 0:</label>
-            <input type="checkbox" name="vpidnotnull" checked="checked"></input>
-            <label for="apidnotnull">${_("apid")} &gt; 0:</label>
-            <input type="checkbox" name="apidnotnull" checked="checked"></input>
+            <input type="submit" value="${_('channel subselection')}" class="actionbutton"></input>
+            <label for="channeltype">${_('channel type')}:
+            </label><select name="channeltype">
+                <option py:for="name in channeltypelist" value="${name}" 
+                    selected="${name == channeltype or None}">${_(name)}</option>
+            </select>
           </form>
-          <br />
+          <br /> &nbsp; &nbsp; &nbsp; &nbsp;
           <form method="get" action="${href.recording('channelsconf/edit')}" class="actionform">
-            <input type="submit" value="${_('channels.conf edit')}" class="actionbutton"></input>
             <select name="adapter">
                 <option py:for="adapter in sorted(adapterlist)" 
                         value="${adapter}">
                         ${adapter}
                 </option>
             </select>
+            <input type="submit" value="${_('channels.conf editor')}" class="actionbutton"></input>
           </form>
    </div>
   <div>${message}</div><br />

src/dvbcronrecording/templates/channelsconf_nav.html

   <div class="actionlist">
+          <form method="get" action="${href.recording('channelsconf/list/video')}" class="actionform">
+            <input type="submit" value="${_('video channels')}" class="actionbutton"></input>
+          </form>
+          <form method="get" action="${href.recording('channelsconf/list/radio')}" class="actionform">
+            <input type="submit" value="${_('radio channels')}" class="actionbutton"></input>
+          </form>
           <form method="get" action="${href.recording('channelsconf/list')}" class="actionform">
             <input type="submit" value="${_('channel.conf show')}" class="actionbutton"></input>
           </form>
+          &nbsp;
           <form method="get" action="${href.recording('channeltuning/list')}" class="actionform">
             <input type="submit" value="${_('tuning list')}" class="actionbutton"></input>
           </form>

src/dvbcronrecording/templates/paginator_datalist.html

   <ul class="pages">
     <li py:for="pagenum in xrange(datalist.num_pages)">
     <span class="${pagenum == datalist.page and 'selected' or ''}">
-      <a href="${href(req.path_info)}?_pagenum=${pagenum}&amp;_pagesize=${_pagesize}">${pagenum+1}</a>
+      <a href="${href(req.path_info)}?_pagenum=${pagenum}&amp;_pagesize=${_pagesize}&amp;${_selection}">${pagenum+1}</a>
     </span>
     </li>
   </ul>
     <li py:for="max_per_page in [10,25,200,1000, datalist.num_items]">
     <span class="${max_per_page == datalist.max_per_page and 'selected' or ''}" py:if="datalist.num_items >= max_per_page">
       <span py:if="datalist.num_items == max_per_page">${_(' of ')}</span>
-      <a href="${href(req.path_info)}?_pagenum=${datalist.page * datalist.max_per_page / max_per_page}&amp;_pagesize=${max_per_page}">${max_per_page}</a>
+      <a href="${href(req.path_info)}?_pagenum=${datalist.page * datalist.max_per_page / max_per_page}&amp;_pagesize=${max_per_page}&amp;${_selection}">${max_per_page}</a>
     </span>
     </li>
   </ul>${_('entries')})
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.