Skip to content

Commit

Permalink
[#451] PEP 8 edits
Browse files Browse the repository at this point in the history
Remove space around "=" in calls to dict()
  • Loading branch information
zzgvh committed Feb 28, 2014
1 parent 45244dd commit 8afeb8f
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions akvo/scripts/cordaid/pre_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,42 +248,42 @@ def set_location_for_org(org_etree, internal_id, org):
if not iso_code == "ww!":
country = custom_get_or_create_country(iso_code)
location = OrganisationLocation.objects.create(
country = country,
location_target = org
country=country,
location_target=org
)
org.locations.add(location)
org.primary_location = location
org.save()
log(
u" Added location to org {pk}",
dict(
log_type = LOG_ORGANISATIONS,
internal_id = internal_id,
pk = org.pk,
label = org.name,
event = ACTION_LOCATION_SET,
log_type=LOG_ORGANISATIONS,
internal_id=internal_id,
pk=org.pk,
label=org.name,
event=ACTION_LOCATION_SET,
)
)
else:
log(
u"Couldn't create location for org {pk}, no proper country code",
dict(
log_type = LOG_ORGANISATIONS,
internal_id = internal_id,
pk = org.pk,
label = org.name,
event = ERROR_COUNTRY_CODE,
log_type=LOG_ORGANISATIONS,
internal_id=internal_id,
pk=org.pk,
label=org.name,
event=ERROR_COUNTRY_CODE,
)
)
else:
log(
u" Org {pk} already has a location.",
dict(
log_type = LOG_ORGANISATIONS,
internal_id = internal_id,
pk = org.pk,
label = org.name,
event = ACTION_LOCATION_FOUND,
log_type=LOG_ORGANISATIONS,
internal_id=internal_id,
pk=org.pk,
label=org.name,
event=ACTION_LOCATION_FOUND,
)
)

Expand Down Expand Up @@ -315,15 +315,15 @@ def organisation_logo(org_etree, internal_id, org):
log(
u" Added logo {extra} to org {pk}, ",
dict(
log_type = LOG_ORGANISATIONS,
internal_id = internal_id,
pk = org.pk,
event = ACTION_SET_IMAGE,
extra = filename,
log_type=LOG_ORGANISATIONS,
internal_id=internal_id,
pk=org.pk,
label=org.name,
event=ACTION_SET_IMAGE,
extra= filename,
)
)


with open(xml_file, "rb") as f:
root = etree.fromstring(f.read())
cordaid = Organisation.objects.get(id=CORDAID_ORG_ID)
Expand All @@ -338,11 +338,11 @@ def organisation_logo(org_etree, internal_id, org):
log(
u"Found existing org {label} (Akvo PK {pk}) with Cordaid internal ID '{internal_id}'",
dict(
log_type = LOG_ORGANISATIONS,
label = internal_org_id.referenced_org.name,
pk = internal_org_id.referenced_org.pk,
internal_id = internal_id,
event = ACTION_FOUND
log_type=LOG_ORGANISATIONS,
label=internal_org_id.referenced_org.name,
pk=internal_org_id.referenced_org.pk,
internal_id=internal_id,
event=ACTION_FOUND
)
)
referenced_org = update_organisation(org_etree, internal_org_id)
Expand All @@ -351,9 +351,9 @@ def organisation_logo(org_etree, internal_id, org):
log(
u"Error from lookup of internal ID {internal_id}. Multiple objects found.",
dict(
log_type = LOG_ORGANISATIONS,
internal_id = internal_id,
event = ERROR_MULTIPLE_OBJECTS
log_type=LOG_ORGANISATIONS,
internal_id=internal_id,
event=ERROR_MULTIPLE_OBJECTS
),
)
continue
Expand Down

0 comments on commit 8afeb8f

Please sign in to comment.