Projet

Général

Profil

0001-misc-add-support-for-importing-site-from-stdin-15665.patch

Frédéric Péters, 02 avril 2017 14:29

Télécharger (1,11 ko)

Voir les différences:

Subject: [PATCH] misc: add support for importing site from stdin (#15665)

 combo/data/management/commands/import_site.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
combo/data/management/commands/import_site.py
15 15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 16

  
17 17
import json
18
import sys
18 19

  
19 20
from django.core.management.base import BaseCommand
20 21

  
......
24 25
    args = ['...']
25 26

  
26 27
    def handle(self, json_file, *args, **kwargs):
27
        Page.load_serialized_pages(json.load(open(json_file)))
28
        if filename == '-':
29
            fd = sys.stdin
30
        else:
31
            fd = open(filename)
32
        Page.load_serialized_pages(json.load(fd))
28
-