[Python-apps-commits] r8461 - in packages/tvnamer/trunk (10 files)

morph at users.alioth.debian.org morph at users.alioth.debian.org
Tue Apr 10 18:12:00 UTC 2012


    Date: Tuesday, April 10, 2012 @ 18:11:58
  Author: morph
Revision: 8461

[svn-inject] Applying Debian modifications (2.2-1) to trunk

Added:
  packages/tvnamer/trunk/debian/
  packages/tvnamer/trunk/debian/changelog
  packages/tvnamer/trunk/debian/compat
  packages/tvnamer/trunk/debian/control
  packages/tvnamer/trunk/debian/copyright
  packages/tvnamer/trunk/debian/readme.md
  packages/tvnamer/trunk/debian/rules
  packages/tvnamer/trunk/debian/source/
  packages/tvnamer/trunk/debian/source/format
  packages/tvnamer/trunk/debian/watch


Property changes on: packages/tvnamer/trunk/debian
___________________________________________________________________
Added: mergeWithUpstream
   + 1

Added: packages/tvnamer/trunk/debian/changelog
===================================================================
--- packages/tvnamer/trunk/debian/changelog	                        (rev 0)
+++ packages/tvnamer/trunk/debian/changelog	2012-04-10 18:11:58 UTC (rev 8461)
@@ -0,0 +1,5 @@
+tvnamer (2.2-1) unstable; urgency=low
+
+  * Initial release (Closes: #668293)
+
+ -- Sandro Tosi <morph at debian.org>  Mon, 09 Apr 2012 11:24:52 +0200

Added: packages/tvnamer/trunk/debian/compat
===================================================================
--- packages/tvnamer/trunk/debian/compat	                        (rev 0)
+++ packages/tvnamer/trunk/debian/compat	2012-04-10 18:11:58 UTC (rev 8461)
@@ -0,0 +1 @@
+8

Added: packages/tvnamer/trunk/debian/control
===================================================================
--- packages/tvnamer/trunk/debian/control	                        (rev 0)
+++ packages/tvnamer/trunk/debian/control	2012-04-10 18:11:58 UTC (rev 8461)
@@ -0,0 +1,16 @@
+Source: tvnamer
+Section: video
+Priority: optional
+Maintainer: Python Applications Packaging Team <python-apps-team at lists.alioth.debian.org>
+Uploaders: Sandro Tosi <morph at debian.org>
+Build-Depends: debhelper (>= 8.0.0), python, python-setuptools, python-support
+Standards-Version: 3.9.3
+X-Python-Version: all
+Homepage: https://github.com/dbr/tvnamer
+
+Package: tvnamer
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, python-tvdb-api (>= 1.5), python-pkg-resources
+Description: utility to rename TV-show episodes files
+ Automatically names downloaded/recorded TV-episodes, by parsing filenames and
+ retrieving show-names from www.thetvdb.com

Added: packages/tvnamer/trunk/debian/copyright
===================================================================
--- packages/tvnamer/trunk/debian/copyright	                        (rev 0)
+++ packages/tvnamer/trunk/debian/copyright	2012-04-10 18:11:58 UTC (rev 8461)
@@ -0,0 +1,50 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: tvnamer
+Source: https://github.com/dbr/tvnamer
+
+Files: *
+Copyright: Copyright 20XX-20XX Ben Dickson (dbr)
+License: Unlicense
+ This is free and unencumbered software released into the public domain.
+ .
+ Anyone is free to copy, modify, publish, use, compile, sell, or
+ distribute this software, either in source code form or as a compiled
+ binary, for any purpose, commercial or non-commercial, and by any
+ means.
+ .
+ In jurisdictions that recognize copyright laws, the author or authors
+ of this software dedicate any and all copyright interest in the
+ software to the public domain. We make this dedication for the benefit
+ of the public at large and to the detriment of our heirs and
+ successors. We intend this dedication to be an overt act of
+ relinquishment in perpetuity of all present and future rights to this
+ software under copyright law.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+ .
+ For more information, please refer to <http://unlicense.org/>
+
+Files: debian/*
+Copyright: 2012 Sandro Tosi <morph at debian.org>
+License: GPL-2+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".

Added: packages/tvnamer/trunk/debian/readme.md
===================================================================
--- packages/tvnamer/trunk/debian/readme.md	                        (rev 0)
+++ packages/tvnamer/trunk/debian/readme.md	2012-04-10 18:11:58 UTC (rev 8461)
@@ -0,0 +1,237 @@
+# `tvnamer`
+
+`tvnamer` is a utility which to rename files from `some.show.s01e03.blah.abc.avi` to `Some Show - [01x03] - The Episode Name.avi` (by retrieving the episode name using data from [`tvdb_api`](http://github.com/dbr/tvdb_api))
+
+## To install
+
+You can easily install `tvnamer` via `easy_install`
+
+    sudo easy_install tvnamer
+
+This installs the `tvnamer` command-line tool (and the `tvdb_api` module as a requirement)
+
+If you wish to install the latest (non-stable) development version from source, download the latest version of the code, either from <http://github.com/dbr/tvnamer/tarball/master> or by running:
+
+    git clone git://github.com/dbr/tvnamer.git
+
+..then `cd` into the directory, and run:
+
+    sudo python setup.py install
+
+Example terminal session (you can skip the `curl` line if you have already downloaded and extracted [the above link](http://github.com/dbr/tvnamer/tarball/master)):
+
+    $ cd Downloads/
+    $ curl -L http://github.com/dbr/tvnamer/tarball/master | gunzip - | tar -x -
+    $ ls
+    dbr-tvnamer-ce3ac8d/
+    $ cd dbr-tvnamer-ce3ac8d/
+    $ sudo python setup.py install
+    Password:
+    [...]
+    Finished processing dependencies for tvnamer==2.0
+
+## Improvements over v1
+
+tvnamer v2 is a near-complete rewrite of the tvnamer released as part of `tvdb_api`. There are many improvements thanks to the improved code structure, but the most important are:
+
+- Support for anime filenames, such as `[Shinsen-Subs] Beet - 19 [24DAB497].mkv`
+- Support for multi-episode files, such as `scrubs.s01e23e24.avi`
+- Custom configuration options (via a JSON config file) and improved command line argument handling
+- Better support for Unicode filenames
+- Support for moving files to specific location after renaming (`/media/tv/{series name}/season {seasonnumber}/` for example)
+
+## Bugs?
+
+Ideally file a ticket on the [tvnamer Lighthouse ticket site](http://dbr.lighthouseapp.com/projects/36049-tvnamer). Lighthouse is preferred, but alternatively you can leave a ticket on on tvnamer's [Github Issues page](http://github.com/dbr/tvnamer/issues)
+
+Please make tickets for any possible bugs or feature requests, or if you discover a filename format that tvnamer cannot parse (as long as a reasonably common format, and has enough information to be parsed!), or if you are struggling with the a custom configuration (please state your desired filename output, and what problems you are encountering)
+
+## Basic usage
+
+From the command line, simply run:
+
+    tvnamer the.file.s01e01.avi
+
+For example:
+
+    $ tvnamer brass.eye.s01e01.avi
+    ####################
+    # Starting tvnamer
+    # Found 1 episodes
+    # Processing brass.eye.s01e01.avi
+    TVDB Search Results:
+    1 -> Brass Eye [en] # http://thetvdb.com/?tab=series&id=70679&lid=7
+    Automatically selecting only result
+    ####################
+    # Old filename: brass.eye.s01e01.avi
+    # New filename: Brass Eye - [01x01] - Animals.avi
+    Rename?
+    ([y]/n/a/q) 
+
+Enter `y` then press `return` and the file will be renamed to "Brass Eye - [01x01] - Animals.avi". You can also simply press `return` to select the default option, denoted by the surrounding `[]`
+
+If there are multiple shows with the same (or similar) names or languages, you will be asked to select the correct one - "Lost" is a good example of this:
+
+    $ tvnamer lost.s01e01.avi 
+    ####################
+    # Starting tvnamer
+    # Found 1 episodes
+    # Processing lost.s01e01.avi
+    TVDB Search Results:
+    1 -> Lost [en] # http://thetvdb.com/?tab=series&id=73739&lid=7
+    2 -> Lost [sv] # http://thetvdb.com/?tab=series&id=73739&lid=8
+    3 -> Lost [no] # http://thetvdb.com/?tab=series&id=73739&lid=9
+    4 -> Lost [fi] # http://thetvdb.com/?tab=series&id=73739&lid=11
+    5 -> Lost [nl] # http://thetvdb.com/?tab=series&id=73739&lid=13
+    6 -> Lost [de] # http://thetvdb.com/?tab=series&id=73739&lid=14
+    Enter choice (first number, ? for help):    
+
+To select the first result, enter `1` then `return`, to select the second enter `2` and so on. The link after `#` goes to the relevant [thetvdb.com][tvdb] page, which will contain information and images to help you select the correct series.
+
+You can rename multiple files, or an entire directory by using the files or directories as arguments:
+
+    $ tvnamer file1.avi file2.avi etc
+    $ tvnamer .
+    $ tvnamer /path/to/my/folder/
+    $ tvnamer ./folder/1/ ./folder/2/
+
+You can skip a specific file by entering `n` (no). If you enter `a` (always) `tvnamer` will rename the remaining files automatically. The suggested use of this is check the first few episodes are named correctly, then use `a` to rename the rest.
+
+Note, tvnamer will only descend one level into directories unless the `-r` (or `--recursive`) flag is specified. For example, if you have the following directory structure:
+
+    dir1/
+        file1.avi
+        dir2/
+            file2.avi
+            file3.avi
+
+..then running `tvnamer dir1/` will only rename `file1.avi`, ignoring `dir2/` and its contents.
+
+If you wish to rename all files (file1, file2 and file3), you would run:
+
+    tvnamer --recursive dir1/
+
+## Command line arguments
+
+There are various flags you can use with `tvnamer`, run..
+
+    tvnamer --help
+
+..to see them, and a short description of each.
+
+The most useful are most likely `--batch`, `--selectfirst` and `--always`:
+
+`--selectfirst` will select the first series the search found, but will not automatically rename any episodes.
+
+`--always` will ask you select the correct series, then automatically rename all files.
+
+`--batch` will not prompt you for anything. It automatically selects the first series search result, and automatically rename all files (identical to using both `--selectfirst` and `--always`). Use carefully!
+
+`--series-id` will allow you to use a specific ID from theTVdb. This can help with name detection issues.
+
+## Configs
+
+One of the largest improvements in tvnamer v2 is the ability to have custom configuration. This allows you to customise behaviour without modifying the code (as was necessary with tvnamer v1).
+
+To write the default JSON configuration file, which is a good starting point for your modifications, simply run:
+
+    tvnamer --save=./mytvnamerconfig.json
+
+To use your custom configuration, you must either specify the location using `tvnamer --config=/path/to/mytvnamerconfig.json` or place the file at `~/.tvnamer.json` (a file named `.tvnamer.json` in your home directory)
+
+**Important:** If tvnamer's default settings change and your saved config contains the old settings, you may experience strange behaviour or bugs (the config may contain a buggy `filename_patterns` regex, for example). It is recommended you remove config options you are not altering (particularly `filename_patterns`). If you experience any strangeness, try disabling your custom configuration (moving it away from `~/.tvnamer.json`)
+
+If for example you wish to change the default language used to retrieve data, change the option `language` to another two-letter language code, such as `fr` for French. Your config file would look like:
+
+    {
+        "language": "fr"
+    }
+
+If `search_all_languages` is true, tvnamer will return multilingual search results. If false, it will return results only in the preferred language.
+
+For an always up-to-date description of all config options, see the comments in [`config_defaults.py`](http://github.com/dbr/tvnamer/blob/master/tvnamer/config_defaults.py)
+
+# Custom output filenames
+
+If you wish to change the output filename format, there are several options you must change:
+
+- One for a file with an episode name (`filename_with_episode`). Example input: `Scrubs.s01e01.my.ep.name.avi`
+- One for a file *without* an episode name (`filename_without_episode`). Example input: `AnUnknownShow.s01e01.avi`
+- One for a filename with no season number, and an episode name (`filename_with_episode_no_season`). Example input: `Sid.The.Science.Kid.E11.avi`
+- One for a filename with no season number, and no episode name (`filename_without_episode_no_season`). Example input: `AnUnknownShow.E24.avi`
+
+This may seem like a lot, but they are mostly the same thing. One for a regular show without and without episode names, and one for a show without the concept of seasons
+
+Say you want the format `Show Name 01x24 Episode Name.avi`, your `filename_with_episode` option would be:
+
+    %(seriesname)s %(seasonno)02dx%(episode)s %(episodename)s%(ext)s
+
+The formatting language used is Python's string formatting feature, which you can read about in the Python documentation, [6.6.2. String Formatting Operations](http://docs.python.org/library/stdtypes.html#string-formatting). Basically it's just `%()s` and the name element you wish to use between `( )`
+
+Note `ext` contains the extension separator symbol, usually `.` - for example `.avi`
+
+Then you need to make a few variants, one without the `episodename` section, and two without the `seasonno` option:
+
+`filename_with_episode_no_season`:
+
+    %(seriesname)s %(seasonno)02dx%(episode)s %(episodename)s%(ext)s
+
+`filename_without_episode`:
+
+    %(seriesname)s %(seasonno)02dx%(episode)s%(ext)s
+
+`filename_without_episode_no_season`:
+
+    %(seriesname)s %(episode)s%(ext)s
+
+There are yet two more options you may want to change, `episode_single` and `episode_separator`
+
+`episode_single` is the Python string formatting pattern used to format the episode number. By default it is `%02d` - this simply turns the number `1` to `01`, and keeps `24` as `24`
+
+If you do not want any padding in your numbers, you could change this to `%d` - this would result in filenames such as `Show - [1x3] - Episode Name.avi` (or `Show 1x3 Episode Name.avi` using your custom name, as described above)
+
+The `episode_separator` option is for multi-episode files. When multiple episodes are detected in one file (such as `Scrubs.s01e01e02.avi`), this string is used to join the episode numbers together. By default it is `-` which results in filenames such as `Scrubs - [01x01-02] - ... .avi`
+
+You could change this to `e`, and by altering the `filename_*` options you could create filenames such as..
+
+    Show - [s01e01e02] - Episode Name.avi
+
+By default, tvnamer will sanitise files for the current operating system - either POSIX-compatible (OS X, Linux, FreeBSD) or Windows. You can force Windows compatible filenames by setting the option `windows_safe_filenames` to True
+
+The preferred way to replace spaces with another character is to use the custom replacements feature. For example, to replace spaces with `.` you would use the config:
+
+    {
+        "output_filename_replacements": [
+            {"is_regex": true,
+            "match": "[ ]",
+            "replacement": "."}
+        ]
+    }
+
+
+You can also remove spaces in characters by adding a space to the option `custom_filename_character_blacklist` and changing the option `replace_blacklisted_characters_with` to `.`
+
+`normalize_unicode_filenames` attempts to replace Unicode characters with their unaccented ASCII equivalent (`Ã¥` becomes `a` etc). Any untranslatable characters are removed.
+
+`selectfirst` and `always_rename` mirror the command line arguments `--selectfirst` and `--always` - one automatically selects the first series search result, the other always renames files. Setting both to True is equivalent to `--batch`. `recursive` also mirrors the command line argument
+
+# Custom filename parsing pattern
+
+`tvnamer` comes with a set of patterns to parse a majority of common (and many uncommon) TV episode file names. If these don't parse your files, you can write custom patterns.
+
+The patterns are regular expressions, compiled with the [`re.VERBOSE` flag](http://docs.python.org/library/re.html#re.VERBOSE). Each pattern must contain several named groups.
+
+Named groups are like regular groups, but the group starts with `?P<thegroupname>`. For example:
+
+    (?P<seriesname>.+?)
+
+All patterns must contain a named group `seriesname` - this is of course the name of the show the filename contains.
+
+Optionally you can parse a season number using the group `seasonnumber`. If this group is not specified, it will search for the episode(s) in season 1 (following the [thetvdb.com][tvdb] convention)
+
+You must also match an episode number group. For simple, single episode files use the group `episodenumber`
+
+If you wish to match multiple episodes in one file, there two options:
+
+- `episodenumber1` `episodenumber2` etc - match any number of episode numbers (can be non-consecutive), or..
+- Two groups, `episodenumberstart` and `episodenumberend` - you match the first and last numbers in the filename. If the start number is 2, and the end number is 5, the file contains episodes [2, 3, 4, 5].

Added: packages/tvnamer/trunk/debian/rules
===================================================================
--- packages/tvnamer/trunk/debian/rules	                        (rev 0)
+++ packages/tvnamer/trunk/debian/rules	2012-04-10 18:11:58 UTC (rev 8461)
@@ -0,0 +1,26 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+%:
+	dh $@
+
+override_dh_clean:
+	dh_clean
+	rm -rf build
+	rm -rf tvnamer.egg-info
+
+override_dh_auto_install:
+	# install library in a private location# and script there too,
+	# so a symlink to /usr/bin would avoid to add the dir to sys.path
+	python setup.py install --root=debian/tmp --install-lib=/usr/share/ \
+	 	--install-scripts=/usr/share/tvnamer/ --no-compile --install-layout=deb
+	dh_install /usr/share/tvnamer/
+
+override_dh_link:
+	dh_link /usr/share/tvnamer/tvnamer /usr/bin/tvnamer
+
+override_dh_installdocs:
+	dh_installdocs debian/readme.md


Property changes on: packages/tvnamer/trunk/debian/rules
___________________________________________________________________
Added: svn:executable
   + *

Added: packages/tvnamer/trunk/debian/source/format
===================================================================
--- packages/tvnamer/trunk/debian/source/format	                        (rev 0)
+++ packages/tvnamer/trunk/debian/source/format	2012-04-10 18:11:58 UTC (rev 8461)
@@ -0,0 +1 @@
+3.0 (quilt)

Added: packages/tvnamer/trunk/debian/watch
===================================================================
--- packages/tvnamer/trunk/debian/watch	                        (rev 0)
+++ packages/tvnamer/trunk/debian/watch	2012-04-10 18:11:58 UTC (rev 8461)
@@ -0,0 +1,2 @@
+version=3
+http://pypi.python.org/packages/source/t/tvnamer/tvnamer-(.*)\.tar.gz




More information about the Python-apps-commits mailing list