Fixed a bug in the delimiter change for the assemble module

reviewable/pr18780/r1
James Cammarata 11 years ago
parent d41afd9a46
commit 8c8c0d4ec4

@ -76,14 +76,14 @@ EXAMPLES = '''
# =========================================== # ===========================================
# Support method # Support method
def assemble_from_fragments(src_path, delimiter=''): def assemble_from_fragments(src_path, delimiter=None):
''' assemble a file from a directory of fragments ''' ''' assemble a file from a directory of fragments '''
tmpfd, temp_path = tempfile.mkstemp() tmpfd, temp_path = tempfile.mkstemp()
tmp = os.fdopen(tmpfd,'w') tmp = os.fdopen(tmpfd,'w')
delimit_me = False delimit_me = False
for f in sorted(os.listdir(src_path)): for f in sorted(os.listdir(src_path)):
fragment = "%s/%s" % (src_path, f) fragment = "%s/%s" % (src_path, f)
if delimit_me: if delimit_me and delimiter:
tmp.write(delimiter) tmp.write(delimiter)
if os.path.isfile(fragment): if os.path.isfile(fragment):
tmp.write(file(fragment).read()) tmp.write(file(fragment).read())

Loading…
Cancel
Save