From 8d2df2db0b314e724172ec8428c16d74b6054515 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Thu, 11 Jul 2019 00:05:35 +0200 Subject: [PATCH] Reorganize files --- data/__init__.py | 0 cities.py => data/cities.py | 0 countries.py => data/countries.py | 0 departments.py => data/departments.py | 0 import/__init__.py | 0 convert_cities.py => import/convert_cities.py | 2 +- main.py | 6 +++--- 7 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 data/__init__.py rename cities.py => data/cities.py (100%) rename countries.py => data/countries.py (100%) rename departments.py => data/departments.py (100%) create mode 100644 import/__init__.py rename convert_cities.py => import/convert_cities.py (94%) diff --git a/data/__init__.py b/data/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/cities.py b/data/cities.py similarity index 100% rename from cities.py rename to data/cities.py diff --git a/countries.py b/data/countries.py similarity index 100% rename from countries.py rename to data/countries.py diff --git a/departments.py b/data/departments.py similarity index 100% rename from departments.py rename to data/departments.py diff --git a/import/__init__.py b/import/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/convert_cities.py b/import/convert_cities.py similarity index 94% rename from convert_cities.py rename to import/convert_cities.py index e3fe0c0..c9ec2a9 100644 --- a/convert_cities.py +++ b/import/convert_cities.py @@ -24,6 +24,6 @@ with open("correspondance-code-insee-code-postal.json", "r") as f: failed.append(base_item) import pprint - with open("cities.py", "w") as writef: + with open("../data/cities.py", "w") as writef: writef.write(pprint.pformat(mapping, indent=4, compact=True)) writef.flush() diff --git a/main.py b/main.py index 4745ba8..ffcb433 100644 --- a/main.py +++ b/main.py @@ -2,9 +2,9 @@ import calendar import datetime import pprint -from departments import DEPARTMENTS -from cities import CITIES -from countries import COUNTRIES, CONTINENTS +from data.departments import DEPARTMENTS +from data.cities import CITIES +from data.countries import COUNTRIES, CONTINENTS class InseeData: