Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1evjSD-0008Cc-NN for pgadmin-hackers@arkaria.postgresql.org; Tue, 13 Mar 2018 12:54:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1evjSC-0005Xm-NL for pgadmin-hackers@arkaria.postgresql.org; Tue, 13 Mar 2018 12:54:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1evjSC-0005Xc-Go for pgadmin-hackers@lists.postgresql.org; Tue, 13 Mar 2018 12:54:56 +0000 Received: from mail-ot0-x243.google.com ([2607:f8b0:4003:c0f::243]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1evjS8-0003n4-2A for pgadmin-hackers@postgresql.org; Tue, 13 Mar 2018 12:54:55 +0000 Received: by mail-ot0-x243.google.com with SMTP id l12so18806082otj.7 for ; Tue, 13 Mar 2018 05:54:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=BYAQvhYjgenucCnmiv7SkiimQec5rsoAONwFDZc0XYM=; b=Rrk26/QotJGPQhR9XG4iNwr9EBszxYJz6RNyuVZNOQBX7ZlegDAdPQ+onRqDg1rO2c zhCshioZssayBnYjqcKi9fTalsSoRj5XaMc6vSEarFL244Y++dVtcqg4Zv1ya/fjd+vF J2R33wnGi8AX0mvGMdq39Z4PrvO/M5vmZBOoXffT5nOlmx4hX3GPsXj3Kf1Mf6XbM+nJ SsDUzPjqkCgIX23g2/gjR1bFweW39Z0kaSisu9eOzuPnyHyyzFLuzS3gWEkaYdLSkiux EHeRjfewb8kMJPJoElND3v0i5E2rnnnsHfgSpbfB48Lnwt7xBL5gSEYO8eN29l8AUcQA u3Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=BYAQvhYjgenucCnmiv7SkiimQec5rsoAONwFDZc0XYM=; b=q7xLxoD6G2IXUQMYidq+R96GDAUugQy84Hnh3dIMBuYS0y4fdT+XyMb+tBzgS1AHrS VnWhJKx60l7p/r19FBA/Cap6GMf157afJQP8B+KY4PzV5VZogqjWR664+/ySLlJbPKxJ 5RQ/gfvknlq8LjLeHZL9OuT3chm3tt7TSUeLSMoTS7iePDIzbfGF8defG7iFdDg/xIjv mby/mhxnmC+9A3VUErNqfD5PBWUrv4Z3kCTiEL25q9rh0PDozIwhglhEw1Fj6K4a6J8h 92m6SqfqBJRcUgYMh/wV1B7qB6dWqVX3ST0oogvQb3AN8tIV6V1RS9VWpftyVu4lI7mI RusA== X-Gm-Message-State: AElRT7HlZL9EJzEEdA41NwM30M6/zhc/zpbe/9f4+qdlRWEpi+PSnVt2 /KRRhHWP2RaKDJ3A0PAi3i4yXzTg9HzDAuzSe/zVEw== X-Google-Smtp-Source: AG47ELu69Ci/fR0JIzdHYqIg09Ux25cjFVUm45TNpnZfqFymOipt+yfoHlPM2GRyHkVKWZNYWQuNEkBItQVY2tpOj7M= X-Received: by 10.157.49.47 with SMTP id e44mr396699otc.46.1520945689296; Tue, 13 Mar 2018 05:54:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.8.150 with HTTP; Tue, 13 Mar 2018 05:54:28 -0700 (PDT) In-Reply-To: References: From: Murtuza Zabuawala Date: Tue, 13 Mar 2018 18:24:28 +0530 Message-ID: Subject: Re: [pgAdmin4][RM#3139] Create proper template path if Windows To: Dave Page Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary="001a113daf6288879d05674ac353" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --001a113daf6288879d05674ac353 Content-Type: text/plain; charset="UTF-8" Hi Dave, I have already replied on another thread regarding the failure of these tests, Joao has already sent a patch for the same. -- Regards, Murtuza Zabuawala EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company On Tue, Mar 13, 2018 at 6:20 PM, Dave Page wrote: > And... reverted. It seems this makes Jenkins very unhappy. > > On Tue, Mar 13, 2018 at 7:58 AM, Dave Page wrote: > >> OK, thanks. Patch applied. >> >> On Tue, Mar 13, 2018 at 12:32 AM, Murtuza Zabuawala < >> murtuza.zabuawala@enterprisedb.com> wrote: >> >>> Hi Dave, >>> >>> We are not joining template path with os.path.join because we are >>> passing prefix paths in render_template(..) at many places, >>> we are passing them as below, >>> >>> Some of examples, >>> >>> render_template( >>> "exclusion_constraint/js/exclusion_constraint.js", >>> _=_ >>> ), >>> >>> recovery_check_sql = render_template( >>> "connect/sql/#{0}#/check_recovery.sql".format(postgres_version)) >>> >>> sql = render_template( >>> "/servers/sql/#{0}#/stats.sql".format(manager.version), >>> conn=conn, _=gettext >>> ) >>> >>> sql = render_template( >>> "/".join([self.template_path, 'create.sql']), >>> data=data, conn=self.conn >>> ) >>> >>> def csssnippets(self): >>> """ >>> Returns a snippet of css to include in the page >>> """ >>> snippets = [render_template("css/servers.css")] >>> >>> >>> So again it will conflict if use os.path.join, To make it consistent >>> with render_template(...) and VersionedTemplateLoader(..) class we >>> opt'd for this mechanism. >>> >>> >>> -- >>> Regards, >>> Murtuza Zabuawala >>> EnterpriseDB: http://www.enterprisedb.com >>> The Enterprise PostgreSQL Company >>> >>> >>> On Tue, Mar 13, 2018 at 6:11 AM, Dave Page wrote: >>> >>>> Hi >>>> >>>> On Mon, Mar 12, 2018 at 10:15 AM, Murtuza Zabuawala < >>>> murtuza.zabuawala@enterprisedb.com> wrote: >>>> >>>>> Hi, >>>>> >>>>> PFA patch to correct the template path generation logic incase of >>>>> Windows system. >>>>> >>>> >>>> Seems like it would be better to fix it the other way round to me - >>>> e.g. update the template loader to use os.path.join. >>>> >>>> Any reason not to do that? >>>> >>>> -- >>>> Dave Page >>>> Blog: http://pgsnake.blogspot.com >>>> Twitter: @pgsnake >>>> >>>> EnterpriseDB UK: http://www.enterprisedb.com >>>> The Enterprise PostgreSQL Company >>>> >>> >>> >> >> >> -- >> Dave Page >> Blog: http://pgsnake.blogspot.com >> Twitter: @pgsnake >> >> EnterpriseDB UK: http://www.enterprisedb.com >> The Enterprise PostgreSQL Company >> > > > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > --001a113daf6288879d05674ac353 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Dave,

I have= already replied on another thread regarding the failure of these tests, Jo= ao has already sent a patch for the same.

= --Regards,=
Murtuza Zabuawala
EnterpriseDB:=C2=A0http://www.enterprisedb.c= om
The Enterprise PostgreSQL Company
<= font size=3D"2">
<= /font>

On Tue, Mar 13, 2018 at 6:20 PM, Dave Page <= span dir=3D"ltr"><dpage@pgadmin.org> wrote:
=
And... reverted. It seems this makes Jenkins very unhappy.=

On Tue, Mar= 13, 2018 at 7:58 AM, Dave Page <dpage@pgadmin.org> wrote:
OK, thanks. Patch applied= .

O= n Tue, Mar 13, 2018 at 12:32 AM, Murtuza Zabuawala <murtu= za.zabuawala@enterprisedb.com> wrote:
Hi Dave,

We are not joining template path with os.path.jo= in because we are passing prefix paths in render_template(..) at many place= s,
we are passing them as below,
Some of examples,

render_template(
=C2=A0 =C2=A0 "exclu= sion_constraint/js/exclusion_constraint.js",
=C2=A0 =C2=A0 _=3D_
),

reco= very_check_sql =3D render_template(
=C2=A0 =C2=A0 =C2=A0 =C2=A0 "connect= /sql/#{0}#/check_recovery.sql".format(postgres_version))

sql = =3D render_template(
=C2=A0 =C2=A0 "/servers/sql/#{0}#/stats.sql"<= wbr>.format(manager.version),
=C2=A0 =C2=A0 conn=3Dconn, _=3Dgettext
)

sql =3D ren= der_template(
=C2=A0 =C2=A0 "/".join([self.template_path, 'creat= e.sql']),
=C2=A0 =C2=A0 data=3Ddata, conn=3Dself.conn
)

def csssnippets(self):=
= =C2=A0 =C2=A0 """
<= font color=3D"#444444" style=3D"background-color:rgb(238,238,238)" face=3D"= arial, helvetica, sans-serif">=C2=A0 =C2=A0 Returns a snippet of css to inc= lude in the page
=C2=A0 =C2=A0 """
=C2=A0 =C2=A0 snippets =3D [ren= der_template("css/servers.css")]


So again it will conflict if use os.p= ath.join, To make it consistent with render_template(...) and=C2=A0Versione= dTemplateLoader(..) class we opt'd for this mechanism.


=
--
Regards,
Murtuza Zabuawala
EnterpriseDB:= =C2=A0http://www.enterprisedb.com
The Enterprise PostgreSQL = Company

=

On Tue, Mar 13, 2018 at 6:11 AM, Dave Page <= span dir=3D"ltr"><dpage@pgadmin.org> wrote:
=
Hi

On Mon, Mar 12, 2018 at 10:15 AM, Murtuza Zabuawala <= ;mu= rtuza.zabuawala@enterprisedb.com> wrote:
Hi,

PFA patch to correct the template path generation logic incase of= Windows system.

Seems like it = would be better to fix it the other way round to me - e.g. update the templ= ate loader to use os.path.join.

Any reason not to = do that?=C2=A0

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

E= nterpriseDB UK: h= ttp://www.enterprisedb.com
The Enterprise PostgreSQL Company




--
Dave P= age
Blog: http= ://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterpri= sedb.com
The Enterprise PostgreSQL Company



--
D= ave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB U= K: http://www.ent= erprisedb.com
The Enterprise PostgreSQL Company

--001a113daf6288879d05674ac353--