Обсуждение: pgAdmin 4 commit: Use the python interpreter explicitly while running t

Поиск
Список
Период
Сортировка

pgAdmin 4 commit: Use the python interpreter explicitly while running t

От
Ashesh Vashi
Дата:
Use the python interpreter explicitly while running the background
process from the runtime.

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=800d5d71d7b6db10cf0d6ab588fa76af8e186161

Modified Files
--------------
web/pgadmin/misc/bgprocess/processes.py | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)


Re: pgAdmin 4 commit: Use the python interpreter explicitly while running t

От
Dave Page
Дата:
Hi

Is config.SERVER_MODE the best test here? pgAdmin4.py does it slightly
differently now, to allow for users that run in desktop mode but
prefer to use their browser (it, in theory, also allows you have
multiple configurations (users) by using server mode on the desktop):

# Start the web server. The port number should have already been set by the
# runtime if we're running in desktop mode, otherwise we'll just use the
# Flask default.
PGADMIN_RUNTIME = False
if 'PGADMIN_PORT' in globals():
    app.logger.debug('Running under the desktop runtime, port: %s',
                     globals()['PGADMIN_PORT'])
    server_port = int(globals()['PGADMIN_PORT'])
    PGADMIN_RUNTIME = True

On Mon, Jun 20, 2016 at 5:01 PM, Ashesh Vashi
<ashesh.vashi@enterprisedb.com> wrote:
> Use the python interpreter explicitly while running the background
> process from the runtime.
>
> Branch
> ------
> master
>
> Details
> -------
> http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=800d5d71d7b6db10cf0d6ab588fa76af8e186161
>
> Modified Files
> --------------
> web/pgadmin/misc/bgprocess/processes.py | 26 +++++++++++++-------------
> 1 file changed, 13 insertions(+), 13 deletions(-)
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers



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

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: pgAdmin 4 commit: Use the python interpreter explicitly while running t

От
Ashesh Vashi
Дата:

On Mon, Jun 20, 2016 at 9:37 PM, Dave Page <dpage@pgadmin.org> wrote:

Hi

Is config.SERVER_MODE the best test here? pgAdmin4.py does it slightly
differently now, to allow for users that run in desktop mode but
prefer to use their browser (it, in theory, also allows you have
multiple configurations (users) by using server mode on the desktop):

# Start the web server. The port number should have already been set by the
# runtime if we're running in desktop mode, otherwise we'll just use the
# Flask default.
PGADMIN_RUNTIME = False
if 'PGADMIN_PORT' in globals():
    app.logger.debug('Running under the desktop runtime, port: %s',
                     globals()['PGADMIN_PORT'])
    server_port = int(globals()['PGADMIN_PORT'])
    PGADMIN_RUNTIME = True
If user has environment variable PGADMIN_PORT to some port, it will give the same result, isn't it?

Do you think - we should check for both PGADMIN_RUNTIME and config.SERVER_MODE?

--
Ashesh
 

On Mon, Jun 20, 2016 at 5:01 PM, Ashesh Vashi
<ashesh.vashi@enterprisedb.com> wrote:
> Use the python interpreter explicitly while running the background
> process from the runtime.
>
> Branch
> ------
> master
>
> Details
> -------
> http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=800d5d71d7b6db10cf0d6ab588fa76af8e186161
>
> Modified Files
> --------------
> web/pgadmin/misc/bgprocess/processes.py | 26 +++++++++++++-------------
> 1 file changed, 13 insertions(+), 13 deletions(-)
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers



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

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: pgAdmin 4 commit: Use the python interpreter explicitly while running t

От
Dave Page
Дата:
On Mon, Jun 20, 2016 at 5:15 PM, Ashesh Vashi
<ashesh.vashi@enterprisedb.com> wrote:
>
> On Mon, Jun 20, 2016 at 9:37 PM, Dave Page <dpage@pgadmin.org> wrote:
>>
>> Hi
>>
>> Is config.SERVER_MODE the best test here? pgAdmin4.py does it slightly
>> differently now, to allow for users that run in desktop mode but
>> prefer to use their browser (it, in theory, also allows you have
>> multiple configurations (users) by using server mode on the desktop):
>>
>> # Start the web server. The port number should have already been set by
>> the
>> # runtime if we're running in desktop mode, otherwise we'll just use the
>> # Flask default.
>> PGADMIN_RUNTIME = False
>> if 'PGADMIN_PORT' in globals():
>>     app.logger.debug('Running under the desktop runtime, port: %s',
>>                      globals()['PGADMIN_PORT'])
>>     server_port = int(globals()['PGADMIN_PORT'])
>>     PGADMIN_RUNTIME = True
>
> If user has environment variable PGADMIN_PORT to some port, it will give the
> same result, isn't it?

It would, but they should just not do that :-)

> Do you think - we should check for both PGADMIN_RUNTIME and
> config.SERVER_MODE?

Then they can't run server mode in the runtime, which I believe there
are good reasons to allow (see above for example).

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

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: pgAdmin 4 commit: Use the python interpreter explicitly while running t

От
Ashesh Vashi
Дата:

On Mon, Jun 20, 2016 at 9:55 PM, Dave Page <dpage@pgadmin.org> wrote:

On Mon, Jun 20, 2016 at 5:15 PM, Ashesh Vashi
<ashesh.vashi@enterprisedb.com> wrote:
>
> On Mon, Jun 20, 2016 at 9:37 PM, Dave Page <dpage@pgadmin.org> wrote:
>>
>> Hi
>>
>> Is config.SERVER_MODE the best test here? pgAdmin4.py does it slightly
>> differently now, to allow for users that run in desktop mode but
>> prefer to use their browser (it, in theory, also allows you have
>> multiple configurations (users) by using server mode on the desktop):
>>
>> # Start the web server. The port number should have already been set by
>> the
>> # runtime if we're running in desktop mode, otherwise we'll just use the
>> # Flask default.
>> PGADMIN_RUNTIME = False
>> if 'PGADMIN_PORT' in globals():
>>     app.logger.debug('Running under the desktop runtime, port: %s',
>>                      globals()['PGADMIN_PORT'])
>>     server_port = int(globals()['PGADMIN_PORT'])
>>     PGADMIN_RUNTIME = True
>
> If user has environment variable PGADMIN_PORT to some port, it will give the
> same result, isn't it?

It would, but they should just not do that :-)
Done. 

> Do you think - we should check for both PGADMIN_RUNTIME and
> config.SERVER_MODE?

Then they can't run server mode in the runtime, which I believe there
are good reasons to allow (see above for example).
Understood.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company



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

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company