Changeset ad2b033f75151402c125239e7e9a155e62877e58
- Timestamp:
- 02/14/08 12:01:48
(11 months ago)
- Author:
- William McBrine <wmcbrine@gmail.com>
- git-committer:
- William McBrine <wmcbrine@gmail.com> 1203012108 -0500
- git-parent:
[165d27727cfe9afafccf7cc593b96c53b0ebb38e]
- git-author:
- William McBrine <wmcbrine@gmail.com> 1203012108 -0500
- Message:
Extraneous code, formatting.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r165d277 |
rad2b033 |
|
| 25 | 25 | def pre_cache(self, full_path): |
|---|
| 26 | 26 | if Video.video_file_filter(self, full_path): |
|---|
| 27 | | return transcode.supported_format(full_path) |
|---|
| 28 | | return False |
|---|
| | 27 | transcode.supported_format(full_path) |
|---|
| 29 | 28 | |
|---|
| 30 | 29 | def video_file_filter(self, full_path, type=None): |
|---|
| r165d277 |
rad2b033 |
|
| 11 | 11 | for section, settings in config.getShares(): |
|---|
| 12 | 12 | httpd.add_container(section, settings) |
|---|
| 13 | | #Precaching of files: does a recursive list of base path |
|---|
| | 13 | # Precaching of files: does a recursive list of base path |
|---|
| 14 | 14 | if settings.get('precache', 'False').lower() == 'true': |
|---|
| 15 | 15 | plugin = GetPlugin(settings.get('type')) |
|---|
| 16 | 16 | if hasattr(plugin,'pre_cache'): |
|---|
| 17 | | print "PreCaching the " + section + " share." |
|---|
| | 17 | print 'Pre-caching the', section, 'share.' |
|---|
| 18 | 18 | pre_cache_filter = getattr(plugin, 'pre_cache') |
|---|
| 19 | 19 | |
|---|
| 20 | 20 | def build_recursive_list(path): |
|---|
| 21 | | files = [] |
|---|
| 22 | | for file in os.listdir(path): |
|---|
| 23 | | file = os.path.join(path, file) |
|---|
| 24 | | if os.path.isdir(file): |
|---|
| 25 | | files.extend(build_recursive_list(file)) |
|---|
| 26 | | continue |
|---|
| 27 | | pre_cache_filter(file) |
|---|
| 28 | | return files |
|---|
| | 21 | for f in os.listdir(path): |
|---|
| | 22 | f = os.path.join(path, f) |
|---|
| | 23 | if os.path.isdir(f): |
|---|
| | 24 | build_recursive_list(f) |
|---|
| | 25 | else: |
|---|
| | 26 | pre_cache_filter(f) |
|---|
| 29 | 27 | |
|---|
| 30 | | files = build_recursive_list(settings.get('path')) |
|---|
| | 28 | build_recursive_list(settings.get('path')) |
|---|
| 31 | 29 | |
|---|
| 32 | 30 | b = beacon.Beacon() |
|---|
| … | … | |
| 36 | 34 | b.listen() |
|---|
| 37 | 35 | |
|---|
| 38 | | print "pyTivo is ready." |
|---|
| | 36 | print 'pyTivo is ready.' |
|---|
| 39 | 37 | try: |
|---|
| 40 | 38 | httpd.serve_forever() |
|---|