Skip to content

Commit 44f51c1

Browse files
committed
The beginning of a dev file download helper.
- Legacy-Id: 16456
1 parent ea8c84d commit 44f51c1

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright The IETF Trust 2019, All Rights Reserved
2+
# -*- coding: utf-8 -*-
3+
4+
5+
from __future__ import absolute_import, print_function, unicode_literals
6+
7+
import os
8+
import subprocess
9+
10+
from textwrap import dedent
11+
12+
from django.core.management.base import BaseCommand
13+
from django.conf import settings
14+
15+
import debug # pyflakes:ignore
16+
17+
class Command(BaseCommand):
18+
"""
19+
Download extra files (photos, floorplans, ...)
20+
"""
21+
22+
help = dedent(__doc__).strip()
23+
24+
def handle(self, *filenames, **options):
25+
for src, dst in (
26+
('rsync.ietf.org::dev.media/', settings.MEDIA_ROOT), ):
27+
if src and dst:
28+
if not dst.endswith(os.pathsep):
29+
dst += os.pathsep
30+
subprocess.call(('rsync', '-auz', '--info=progress2', src, dst))
31+

0 commit comments

Comments
 (0)