Added mention of travis-ci to contributing doc

This commit is contained in:
Jesse Mullan
2014-11-19 16:44:04 -08:00
parent 7f740b1fc3
commit a72bbf29f6
4 changed files with 17 additions and 9 deletions

View File

@@ -20,7 +20,7 @@ The code should work with Python 2.6 and 2.7. Note that Headphones runs on diffe
Re-use existing code. Do not hesitate to add logging in your code. You can the logger module `headphones.logger.*` for this. Web requests are invoked via `headphones.request.*` and derived ones. Use these methods to automatically add proper and meaningful error handling.
### Code conventions
Altough Headphones did not adapt a code convention in the past, we try to follow the [PEP8](http://legacy.python.org/dev/peps/pep-0008/) conventions for future code. A short summary to remind you (copied from http://wiki.ros.org/PyStyleGuide):
Although Headphones did not adapt a code convention in the past, we try to follow the [PEP8](http://legacy.python.org/dev/peps/pep-0008/) conventions for future code. A short summary to remind you (copied from http://wiki.ros.org/PyStyleGuide):
* 4 space indentation
* 80 characters per line
@@ -32,4 +32,7 @@ Altough Headphones did not adapt a code convention in the past, we try to follow
* `self.__really_private_field`
* `_global`
Document your code!
Document your code!
### Continuous Integration
Headphones has a configuration file for [travis-ci](https://travis-ci.org/). You can add your forked repo to travis to have it check your code against pep8, pylint, and pyflakes for you. Your pull request will show a green check mark or a red x on each tested commit, depending on if linting passes.

View File

@@ -1,11 +1,12 @@
import os.path
from biplist import *
import biplist
from headphones import logger
def getXldProfile(xldProfile):
xldProfileNotFound = xldProfile
expanded = os.path.expanduser('~/Library/Preferences/jp.tmkk.XLD.plist')
if not os.path.isfile(expanded):
logger.warn("Could not find xld preferences at: %s", expanded)
@@ -13,14 +14,18 @@ def getXldProfile(xldProfile):
# Get xld preferences plist
try:
preferences = readPlist(expanded)
except (InvalidPlistException, NotBinaryPlistException), e:
preferences = biplist.readPlist(expanded)
except (biplist.InvalidPlistException, biplist.NotBinaryPlistException), e:
logger.error("Error reading xld preferences plist: %s", e)
return(xldProfileNotFound, None, None)
xldProfile = xldProfile.lower()
profiles = preferences.get('Profiles')
if not isinstance(preferences, dict):
logger.error("Error reading xld preferences plist, not a dict: %r", preferences)
return(xldProfileNotFound, None, None)
profiles = preferences.get('Profiles', []) # pylint:disable=E1103
xldProfile = xldProfile.lower()
for profile in profiles:
profilename = profile.get('XLDProfileManager_ProfileName')

View File

@@ -1221,4 +1221,4 @@ def forcePostProcess(dir=None, expand_subfolders=True, album_dir=None):
logger.info("Couldn't parse '%s' into any valid format. If adding " \
"albums from another source, they must be in an 'Artist - Album " \
"[Year]' format, or end with the musicbrainz release group id.",
folder_basename)
folder_basename)

View File

@@ -184,4 +184,4 @@ def torrentAction(method, arguments):
logger.error("Error sending torrent to Transmission")
return
return response
return response