Просмотр исходного кода

Added shim for backward compatibility

Nuwan Goonasekera 7 лет назад
Родитель
Сommit
5b36923907
1 измененных файлов с 12 добавлено и 0 удалено
  1. 12 0
      cloudbridge/cloud/__init__.py

+ 12 - 0
cloudbridge/cloud/__init__.py

@@ -0,0 +1,12 @@
+import warnings
+from os.path import join
+
+warnings.warn(
+    "The cloud package is deprecated and everything under it has been moved "
+    "one level up. For example, instead of "
+    "`from cloudbridge.cloud.factory import CloudProviderFactory` use "
+    "`from cloudbridge.factory import CloudProviderFactory`. In future "
+    "versions, the cloud package will be completely removed.",
+    category=RuntimeWarning)
+# Redirect package one level up for backward compatibility
+__path__.insert(0, join(__path__[0], ".."))