Changeset 94b342742c134175c5d99ca32205b7cf6e941ee5
- Timestamp:
- 11/24/06 19:21:00
(2 years ago)
- Author:
- Jason Michalski <armooo@armooo.net>
- git-committer:
- Jason Michalski <armooo@armooo.net> 1164417660 +0000
- git-parent:
[047584cfad186d4dd2c6feee9e21e74f663b76fc]
- git-author:
- Jason Michalski <armooo@armooo.net> 1164417660 +0000
- Message:
pyTivo
- Added Config file
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rf17b49b |
r94b3427 |
|
| 1 | | import beacon, httpserver |
|---|
| | 1 | import beacon, httpserver, ConfigParser |
|---|
| 2 | 2 | |
|---|
| 3 | | httpd = httpserver.TivoHTTPServer(('', 9032), httpserver.TivoHTTPHandler) |
|---|
| 4 | | httpd.add_container('test', 'x-container/tivo-videos', r'C:\Documents and Settings\Armooo\Desktop\pyTivo\test') |
|---|
| | 3 | config = ConfigParser.ConfigParser() |
|---|
| | 4 | config.read('pyTivo.conf') |
|---|
| | 5 | |
|---|
| | 6 | port = config.get('Server', 'Port') |
|---|
| | 7 | |
|---|
| | 8 | httpd = httpserver.TivoHTTPServer(('', int(port)), httpserver.TivoHTTPHandler) |
|---|
| | 9 | |
|---|
| | 10 | for section in config.sections(): |
|---|
| | 11 | if not section == 'Server': |
|---|
| | 12 | httpd.add_container(section, config.get(section, 'type'), config.get(section, 'path')) |
|---|
| 5 | 13 | |
|---|
| 6 | 14 | b = beacon.Beacon() |
|---|
| 7 | | b.add_service('TiVoMediaServer:9032/http') |
|---|
| | 15 | b.add_service('TiVoMediaServer:' + str(port) + '/http') |
|---|
| 8 | 16 | b.send_beacon_timer() |
|---|
| 9 | 17 | |
|---|
| rf17b49b |
r94b3427 |
|
| 8 | 8 | </Details> |
|---|
| 9 | 9 | |
|---|
| | 10 | #for $name, $details in $containers.items() |
|---|
| 10 | 11 | <Item> |
|---|
| 11 | | #for $name, $details in $containers.items() |
|---|
| 12 | 12 | <Details> |
|---|
| 13 | 13 | <Title>$name</Title> |
|---|
| … | … | |
| 21 | 21 | </Content> |
|---|
| 22 | 22 | </Links> |
|---|
| 23 | | #end for |
|---|
| 24 | 23 | </Item> |
|---|
| | 24 | #end for |
|---|
| 25 | 25 | |
|---|
| 26 | 26 | <ItemStart>0</ItemStart> |
|---|
| r047584c |
r94b3427 |
|
| 34 | 34 | else: |
|---|
| 35 | 35 | settings = [] |
|---|
| 36 | | settings.apppend('-aspect 16:9') |
|---|
| | 36 | settings.append('-aspect 16:9') |
|---|
| 37 | 37 | |
|---|
| 38 | 38 | endHeight = (720*width)/height |
|---|