meringue 0.3.1__py2.7.egg → 0.3.3__py2.7.egg

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
EGG-INFO/PKG-INFO CHANGED
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: Meringue
3
- Version: 0.3.1
3
+ Version: 0.3.3
4
4
  Summary: Weboven django base package
5
5
  Home-page: https://github.com/dd/Meringue
6
6
  Author: weboven team
@@ -55,6 +55,14 @@ Description: ========
55
55
  ---------------
56
56
 
57
57
 
58
+ 0.3.2
59
+ -------------
60
+
61
+ * put_css/put_js:
62
+
63
+ - поправлена ссылка на .map
64
+ - добавлен параметр MERINGUE_LOAD_MINI в settings указывающий загружать минифицированный файл или нет (default = DEBUG)
65
+
58
66
  0.3.1.alpha.4
59
67
  -------------
60
68
 
@@ -71,6 +79,7 @@ Description: ========
71
79
  * PublishModel mtime field
72
80
  * PublishModel ctime field
73
81
  * put_css/put_js:
82
+
74
83
  - по возможности выводит минифицированный файл
75
84
  - в min переделывает ссылку на .map
76
85
  - переработана внутренняя составляющая в отдельный класс
meringue/__init__.py CHANGED
@@ -1,9 +1,9 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  __VERSION__ = (
4
- (0, 3, 1),
5
- # ('a', 4),
6
- # ('dev', 7)
4
+ (0, 3, 3),
5
+ # ('a', 1),
6
+ # ('dev', 1)
7
7
  )
8
8
 
9
9
  try:
meringue/__init__.pyc CHANGED
Binary file
meringue/middleware.pyc CHANGED
Binary file
meringue/models.pyc CHANGED
Binary file
meringue/settings.py CHANGED
@@ -81,3 +81,14 @@ DEFAULT_PHONE_LOCALIZATION = getattr(
81
81
  'MERINGUE_DEFAULT_PHONE_LOCALIZATION',
82
82
  'RU'
83
83
  )
84
+
85
+
86
+ ##############
87
+ # PUT CSS/JS #
88
+ ##############
89
+
90
+ LOAD_MINI = getattr(
91
+ settings,
92
+ 'MERINGUE_LOAD_MINI',
93
+ not settings.DEBUG
94
+ )
meringue/settings.pyc CHANGED
Binary file
@@ -70,7 +70,7 @@ class PutStatic:
70
70
  def _load_static_file(self):
71
71
  file = None
72
72
 
73
- if self.load_min:
73
+ if self.load_min and m_settings.LOAD_MINI:
74
74
  try:
75
75
  file = self._load_file(os.path.join(
76
76
  self.dir,
@@ -99,12 +99,23 @@ class PutStatic:
99
99
  result = text
100
100
  return result
101
101
 
102
+
102
103
  def _fix_map_link(self, text):
104
+
105
+ def _calculate_map_link(m):
106
+ result = 'sourceMappingURL=%s%s'
107
+ if m.groupdict()['scheme']:
108
+ return result % (m.groupdict()['scheme'], m.groupdict()['path'])
109
+
110
+ if m.groupdict()['path'].startswith('/'):
111
+ return result % (settings.STATIC_URL, m.groupdict()['path'])
112
+
113
+ return result % (settings.STATIC_URL, "/".join([self.dir, m.groupdict()['path']]))
114
+
103
115
  result = re.sub(
104
116
  re.compile(ur'sourceMappingURL=(?P<scheme>https:\/\/|http:\/\/|\/\/)?(?P<path>[\w\.]+)',
105
117
  re.UNICODE),
106
- lambda m: 'sourceMappingURL=%s%s' % (settings.STATIC_URL,
107
- m.groupdict()['path']),
118
+ _calculate_map_link,
108
119
  text
109
120
  )
110
121
  return result
Binary file