Skip to content

Commit

Permalink
Create formatted block comments for Utils
Browse files Browse the repository at this point in the history
This commit introduces a Django style commenting block for the Utils
module following discussion around the original PR submitted against
this code. The block-comments are significantly different from the
alternative single hash (`# Comment.`) approach which has a different
set of guidelines associated with it in the Artefactual coding
style-guide.

It is hoped the new block comment style will be clearer
to devs looking at the code for the first time.
  • Loading branch information
ross-spencer committed Sep 24, 2018
1 parent 3805530 commit 0eaa19f
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions metsrw/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
from six.moves.urllib.parse import quote_plus, urlparse, urlunparse


# LXML HELPERS
####################################
# LXML HELPER VALUES AND FUNCTIONS #
####################################

NAMESPACES = {
"xsi": "http://www.w3.org/2001/XMLSchema-instance",
"mets": "http://www.loc.gov/METS/",
Expand All @@ -22,12 +25,18 @@ def lxmlns(arg):
return '{' + NAMESPACES[arg] + '}'


# CONSTANTS
####################
# METSRW CONSTANTS #
####################

FILE_ID_PREFIX = 'file-'
GROUP_ID_PREFIX = 'Group-'


# URL helpers
#################################
# HELPERS FOR MANIPULATING URLS #
#################################

def urlencode(url):
"""Replace unsafe ASCII characters using percent encoding as per RFC3986:
https://tools.ietf.org/html/rfc3986#section-2.1.
Expand Down

0 comments on commit 0eaa19f

Please sign in to comment.