Commits

David Warburton committed 4ff40f0

when ssl is not enabled (linux) fall back to http protocol.

Comments (0)

Files changed (1)

 import dateutil, yaml, shopify
 import json, os, threading, re
 
+try:
+    import ssl
+except Exception, e:
+    admin_url_template = "http://%s:%s@%s.myshopify.com/admin"
+else:
+    admin_url_template = "https://%s:%s@%s.myshopify.com/admin"
+
 def load():
     global stores, store_keys, current_store, current_theme, api_lock
     store_template = """{
     api_lock = threading.Lock()
 
 def connect(shop):
-    shopify.ShopifyResource.site = "https://%s:%s@%s.myshopify.com/admin" % (shop['API_KEY'], shop['API_PASSWORD'], shop['SHOP_NAME'])
+    shopify.ShopifyResource.site = admin_url_template % (shop['API_KEY'], shop['API_PASSWORD'], shop['SHOP_NAME'])
 
 class ShopifyShowStoresCommand(sublime_plugin.WindowCommand):
     def run(self):