<?xml version="1.0"?>
<ZopeData>
  <record id="1" aka="AAAAAAAAAAE=">
    <pickle>
      <tuple>
        <tuple>
          <string>Products.PythonScripts.PythonScript</string>
          <string>PythonScript</string>
        </tuple>
        <none/>
      </tuple>
    </pickle>
    <pickle>
      <dictionary>
        <item>
            <key> <string>Python_magic</string> </key>
            <value>
              <none/>
            </value>
        </item>
        <item>
            <key> <string>Script_magic</string> </key>
            <value> <int>3</int> </value>
        </item>
        <item>
            <key> <string>__ac_local_roles__</string> </key>
            <value>
              <none/>
            </value>
        </item>
        <item>
            <key> <string>_bind_names</string> </key>
            <value>
              <object>
                <klass>
                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
                </klass>
                <tuple/>
                <state>
                  <dictionary>
                    <item>
                        <key> <string>_asgns</string> </key>
                        <value>
                          <dictionary>
                            <item>
                                <key> <string>name_container</string> </key>
                                <value> <string>container</string> </value>
                            </item>
                            <item>
                                <key> <string>name_context</string> </key>
                                <value> <string>context</string> </value>
                            </item>
                            <item>
                                <key> <string>name_m_self</string> </key>
                                <value> <string>script</string> </value>
                            </item>
                            <item>
                                <key> <string>name_subpath</string> </key>
                                <value> <string>traverse_subpath</string> </value>
                            </item>
                          </dictionary>
                        </value>
                    </item>
                  </dictionary>
                </state>
              </object>
            </value>
        </item>
        <item>
            <key> <string>_body</string> </key>
            <value> <string encoding="cdata"><![CDATA[

#  Define the Two dates (Start date and stop date ) that will be \n
#  used by Planning Box at secondary axis and also used as SQL params\n
#  at list method.\n
#\n
#  Returned a list with 2 dates which is normalized as;\n
#\n
#  - Days always starts at 0H and finish at 0h of the next day.\n
#  \n
#  - Weeks always starts at 0H of the last Sunday and finish at 0h of\n
#  the next sunday.\n
#\n
#  - Months always starts at 0h of the current month\'s first day  and \n
#  finish 0h of the next month\'s first day.\n
#\n
#  - Years always starts at 0h of the current year\'s first day  and \n
#    finish 0h of the next year\'s first day.\n
#  \n
\n
zoom = context.portal_categories.zoom\n
\n
# Normalize Day.\n
bound_start = DateTime(DateTime(bound_begin).strftime("%Y/%m/%d"))\n
bound_stop = bound_start\n
if int(zoom_level) == zoom.first_zoom_level.getIntIndex():\n
  bound_start = bound_start + zoom_variation\n
  bound_stop = bound_start + 1\n
\n
if int(zoom_level) == zoom.second_zoom_level.getIntIndex():\n
  # Normalize Week.\n
  while bound_start.Day() is not \'Sunday\':\n
    bound_start = bound_start - 1\n
  bound_start = bound_start + 7 * zoom_variation\n
  bound_stop = bound_start + 7\n
 \n
if int(zoom_level) == zoom.third_zoom_level.getIntIndex():\n
  # Normalize Month.\n
  month = bound_start.month() + zoom_variation\n
  year = bound_start.year() + (month - 1) / 12\n
  month = month % 12\n
  if month == 0:\n
    month = 12\n
  bound_start = DateTime(year, month, 1)\n
  if month >= 12:\n
    year = year + 1\n
    month = 1\n
  else:\n
    month = month + 1\n
  bound_stop = DateTime(year, month, 1)\n
\n
if int(zoom_level) == zoom.fourth_zoom_level.getIntIndex():\n
  # Normalize Year.\n
  year = bound_start.year() + zoom_variation\n
  bound_start = DateTime(year, 1, 1)\n
  bound_stop = DateTime(year+1, 1, 1)\n
\n
return [bound_start , bound_stop]\n


]]></string> </value>
        </item>
        <item>
            <key> <string>_code</string> </key>
            <value>
              <none/>
            </value>
        </item>
        <item>
            <key> <string>_filepath</string> </key>
            <value>
              <none/>
            </value>
        </item>
        <item>
            <key> <string>_owner</string> </key>
            <value>
              <none/>
            </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string>bound_begin=None, zoom_level=1,zoom_variation=0</string> </value>
        </item>
        <item>
            <key> <string>errors</string> </key>
            <value>
              <tuple/>
            </value>
        </item>
        <item>
            <key> <string>func_code</string> </key>
            <value>
              <object>
                <klass>
                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
                </klass>
                <tuple/>
                <state>
                  <dictionary>
                    <item>
                        <key> <string>co_argcount</string> </key>
                        <value> <int>3</int> </value>
                    </item>
                    <item>
                        <key> <string>co_varnames</string> </key>
                        <value>
                          <tuple>
                            <string>bound_begin</string>
                            <string>zoom_level</string>
                            <string>zoom_variation</string>
                            <string>_getattr_</string>
                            <string>context</string>
                            <string>zoom</string>
                            <string>DateTime</string>
                            <string>bound_start</string>
                            <string>bound_stop</string>
                            <string>int</string>
                            <string>month</string>
                            <string>year</string>
                          </tuple>
                        </value>
                    </item>
                  </dictionary>
                </state>
              </object>
            </value>
        </item>
        <item>
            <key> <string>func_defaults</string> </key>
            <value>
              <tuple>
                <none/>
                <int>1</int>
                <int>0</int>
              </tuple>
            </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>planning_validate_date_list</string> </value>
        </item>
        <item>
            <key> <string>warnings</string> </key>
            <value>
              <tuple/>
            </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
