Loading ...
Sorry, an error occurred while loading the content.
 

Re: [Cheetahtemplate-discuss] #extend template in different directory?

Expand Messages
  • Tavis Rudd
    On May 31, 2002 09:52 am, Tavis Rudd wrote: ... Oops, I m wrong about limits in Linux. There s a PAM module that allows you to set per session limits for a
    Message 1 of 9 , May 31, 2002
      On May 31, 2002 09:52 am, Tavis Rudd wrote:
      ...
      > * if you are using an OS that allows per user file system quotas, CPU usage
      > quotas, mem usage quotas, disk access quotas, etc. you can set different
      > limits for each site (FreeBSD and Solaris can. I don't think Linux can yet)

      Oops, I'm wrong about limits in Linux. There's a PAM module that allows you
      to set per session limits for a variety of system resources:
      http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/pam-6.html#ss6.12

      _______________________________________________________________

      Don't miss the 2002 Sprint PCS Application Developer's Conference
      August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

      _______________________________________________
      Cheetahtemplate-discuss mailing list
      Cheetahtemplate-discuss@...
      https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
    • Andy Gimblett
      Thanks for the feedback on this question... I ve been away for the last week so haven t had chance to reply yet. :-) ... That s a fairly clean solution, but
      Message 2 of 9 , Jun 7, 2002
        Thanks for the feedback on this question... I've been away for the
        last week so haven't had chance to reply yet. :-)

        On Fri, May 31, 2002 at 11:12:44AM -0500, Ian Bicking wrote:

        > Alternatively if all the site paths were in the same directory (like
        > /www/site1/master.tmpl, /www/site2/master.tmpl, etc)., then you could
        > add /www, make sure /www/site1/__init__.py exists, and do
        > #from site1.master import master

        That's a fairly clean solution, but still doesn't give me a pythonic
        way to extend PYTHONPATH (ie I'd still need to do it in another
        script, eg .bashrc, wouldn't I?)

        > I could imagine a Cheetah compiler setting to extend the path, or a
        > command line option to extend the path, but I don't believe either of
        > these exist.

        That sounds like a useful option to have... I might just do that.
        I've alrady hacked the compiler to add a couple of command-line
        options I wanted, so I'll have a play and let you know how I get on.
        Presumably a better place to discuss modifications to the compiler
        would be the development list?

        Thanks for your help,

        Andy

        --
        Andy Gimblett - Programmer - Frontier Internet Services Limited
        Tel: 029 20 820 044 Fax: 029 20 820 035 http://www.frontier.net.uk/
        Statements made are at all times subject to Frontier's Terms and
        Conditions of Business, which are available upon request.

        _______________________________________________________________

        Don't miss the 2002 Sprint PCS Application Developer's Conference
        August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

        _______________________________________________
        Cheetahtemplate-discuss mailing list
        Cheetahtemplate-discuss@...
        https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
      • Mike Orr
        ... Refresh my memory, this is for Webware? What s wrong with extending the path in the script that launches Webware? Or did you want a different path for
        Message 3 of 9 , Jun 7, 2002
          > On Fri, May 31, 2002 at 11:12:44AM -0500, Ian Bicking wrote:
          >
          > > Alternatively if all the site paths were in the same directory (like
          > > /www/site1/master.tmpl, /www/site2/master.tmpl, etc)., then you could
          > > add /www, make sure /www/site1/__init__.py exists, and do
          > > #from site1.master import master
          >
          > That's a fairly clean solution, but still doesn't give me a pythonic
          > way to extend PYTHONPATH (ie I'd still need to do it in another
          > script, eg .bashrc, wouldn't I?)

          Refresh my memory, this is for Webware? What's wrong with extending
          the path in the script that launches Webware?

          Or did you want a different path for different Webware contexts?
          That sounds like more a Webware problem than something each template
          should solve for itself.

          However, if we do decide on a #pythonpath directive, I wouldn't oppose it.

          On the other hand,
          #silent $sys.path.insert(0, 'DIR')
          does the same thing. As it happens, 'sys' is already accessible
          without importing, along with 'os'. ('time' and 'types' are also,
          but I wouldn't cast that in stone forever.)

          To prevent the same directory from being added multiple times,
          we could have a method
          #silent $pythonPath('DIR')
          which would do:
          if dir not in sys.path:
          sys.path.insert(0, dir)

          The syntactical tradeoff would be conciseness for #pythonpath,
          and creeping featurism of directives for $pythonPath.

          --
          -Mike (Iron) Orr, iron@... (if mail problems: mso@...)
          http://iron.cx/ English * Esperanto * Russkiy * Deutsch * Espan~ol

          _______________________________________________________________

          Don't miss the 2002 Sprint PCS Application Developer's Conference
          August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

          _______________________________________________
          Cheetahtemplate-discuss mailing list
          Cheetahtemplate-discuss@...
          https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
        • Tavis Rudd
          ... What s wrong with that? ... export PYTHONPATH=xxxxx && cheetah xxxxxx ... You can already do that with: $*sys.path.insert($yourPath) ## caching or #if not
          Message 4 of 9 , Jun 7, 2002
            On June 7, 2002 02:05 am, Andy Gimblett wrote:
            > Thanks for the feedback on this question... I've been away for the
            > last week so haven't had chance to reply yet. :-)
            >
            > On Fri, May 31, 2002 at 11:12:44AM -0500, Ian Bicking wrote:
            > > Alternatively if all the site paths were in the same directory (like
            > > /www/site1/master.tmpl, /www/site2/master.tmpl, etc)., then you could
            > > add /www, make sure /www/site1/__init__.py exists, and do
            > > #from site1.master import master
            >
            > That's a fairly clean solution, but still doesn't give me a pythonic
            > way to extend PYTHONPATH (ie I'd still need to do it in another
            > script, eg .bashrc, wouldn't I?)

            What's wrong with that?

            > > I could imagine a Cheetah compiler setting to extend the path, or a
            > > command line option to extend the path, but I don't believe either of
            > > these exist.

            export PYTHONPATH=xxxxx && cheetah xxxxxx

            > That sounds like a useful option to have... I might just do that.
            > I've alrady hacked the compiler to add a couple of command-line
            > options I wanted, so I'll have a play and let you know how I get on.

            You can already do that with:
            $*sys.path.insert($yourPath) ## caching
            or
            #if not $yourPath in $sys.path
            $sys.path.insert($yourPath)
            #end if

            I'd prefer not to add a new directive.

            > Presumably a better place to discuss modifications to the compiler
            > would be the development list?

            We haven't actually been using the devel list. This one is used for
            everything.

            Cheers,
            Tavis

            _______________________________________________________________

            Don't miss the 2002 Sprint PCS Application Developer's Conference
            August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

            _______________________________________________
            Cheetahtemplate-discuss mailing list
            Cheetahtemplate-discuss@...
            https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
          • Mike Orr
            ... Or: PYTHONPATH=xxxxx cheetah xxxxx -- -Mike (Iron) Orr, iron@mso.oz.net (if mail problems: mso@oz.net) http://iron.cx/ English * Esperanto * Russkiy
            Message 5 of 9 , Jun 7, 2002
              On Fri, Jun 07, 2002 at 09:55:38AM -0700, Tavis Rudd wrote:
              > export PYTHONPATH=xxxxx && cheetah xxxxxx

              Or:
              PYTHONPATH=xxxxx cheetah xxxxx

              --
              -Mike (Iron) Orr, iron@... (if mail problems: mso@...)
              http://iron.cx/ English * Esperanto * Russkiy * Deutsch * Espan~ol

              _______________________________________________________________

              Don't miss the 2002 Sprint PCS Application Developer's Conference
              August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

              _______________________________________________
              Cheetahtemplate-discuss mailing list
              Cheetahtemplate-discuss@...
              https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
            • Mike Orr
              ... No, because that would be interpreted as #if (not $yourPath) in $sys.path Better to use the explicit not in operator: #if $yourPath not in $sys.path --
              Message 6 of 9 , Jun 7, 2002
                On Fri, Jun 07, 2002 at 09:55:38AM -0700, Tavis Rudd wrote:
                > #if not $yourPath in $sys.path
                > $sys.path.insert($yourPath)
                > #end if

                No, because that would be interpreted as
                #if (not $yourPath) in $sys.path

                Better to use the explicit 'not in' operator:
                #if $yourPath not in $sys.path

                --
                -Mike (Iron) Orr, iron@... (if mail problems: mso@...)
                http://iron.cx/ English * Esperanto * Russkiy * Deutsch * Espan~ol

                _______________________________________________________________

                Don't miss the 2002 Sprint PCS Application Developer's Conference
                August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

                _______________________________________________
                Cheetahtemplate-discuss mailing list
                Cheetahtemplate-discuss@...
                https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
              Your message has been successfully submitted and would be delivered to recipients shortly.