Thread: [pgAdmin] [RM#3831] Utility script to update copyright information

[pgAdmin] [RM#3831] Utility script to update copyright information

From
Murtuza Zabuawala
Date:
Hi,

Please find the utility script which will allow us to update the copyright information in one shot.

Usage:
python copyright_updater.py <year to find> <year to replace with>
python copyright_updater.py 2018 2019

Please review.

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

Attachment

Re: [pgAdmin] [RM#3831] Utility script to update copyright information

From
Dave Page
Date:
Hi
On Wed, Dec 19, 2018 at 2:33 PM Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote:
Hi,

Please find the utility script which will allow us to update the copyright information in one shot.

Usage:
python copyright_updater.py <year to find> <year to replace with>
python copyright_updater.py 2018 2019

Please review.

Neat. But...

Changing copyright information of file: `/Users/dpage/git/postgresql/contrib/unaccent/sql/unaccent.sql`

Traceback (most recent call last):

  File "web/copyright_updater.py", line 80, in <module>

    files_affected = findReplace('..', sys.argv[1], sys.argv[2])

  File "web/copyright_updater.py", line 47, in findReplace

    content = fp.read()

  File "/Users/dpage/.virtualenvs/pgadmin4/bin/../lib/python3.6/codecs.py", line 321, in decode

    (result, consumed) = self._buffer_decode(data, self.errors, final)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa3 in position 164: invalid start byte 


:-(

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

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

Re: [pgAdmin] [RM#3831] Utility script to update copyright information

From
Murtuza Zabuawala
Date:
Hi Dave,

Please find an updated patch.

(Happy holidays)

On Wed, 19 Dec 2018, 20:56 Dave Page <dpage@pgadmin.org wrote:
Hi
On Wed, Dec 19, 2018 at 2:33 PM Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote:
Hi,

Please find the utility script which will allow us to update the copyright information in one shot.

Usage:
python copyright_updater.py <year to find> <year to replace with>
python copyright_updater.py 2018 2019

Please review.

Neat. But...

Changing copyright information of file: `/Users/dpage/git/postgresql/contrib/unaccent/sql/unaccent.sql`

Traceback (most recent call last):

  File "web/copyright_updater.py", line 80, in <module>

    files_affected = findReplace('..', sys.argv[1], sys.argv[2])

  File "web/copyright_updater.py", line 47, in findReplace

    content = fp.read()

  File "/Users/dpage/.virtualenvs/pgadmin4/bin/../lib/python3.6/codecs.py", line 321, in decode

    (result, consumed) = self._buffer_decode(data, self.errors, final)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa3 in position 164: invalid start byte 


:-(

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

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

Re: [pgAdmin] [RM#3831] Utility script to update copyright information

From
Dave Page
Date:
Hi

Thanks - committed with a few minor changes:

- Message tweaks
- Don't lose the comma after the second year, or the tool will only work once
- Put it in a new utilities/ directory
- Scan .pro and .plist files as well.
On Thu, Dec 20, 2018 at 7:55 AM Murtuza Zabuawala
<murtuza.zabuawala@enterprisedb.com> wrote:
>
> Hi Dave,
>
> Please find an updated patch.
>
> (Happy holidays)
>
> On Wed, 19 Dec 2018, 20:56 Dave Page <dpage@pgadmin.org wrote:
>>
>> Hi
>> On Wed, Dec 19, 2018 at 2:33 PM Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote:
>>>
>>> Hi,
>>>
>>> Please find the utility script which will allow us to update the copyright information in one shot.
>>>
>>> Usage:
>>> python copyright_updater.py <year to find> <year to replace with>
>>> python copyright_updater.py 2018 2019
>>>
>>> Please review.
>>
>>
>> Neat. But...
>>
>> Changing copyright information of file: `/Users/dpage/git/postgresql/contrib/unaccent/sql/unaccent.sql`
>>
>> Traceback (most recent call last):
>>
>>   File "web/copyright_updater.py", line 80, in <module>
>>
>>     files_affected = findReplace('..', sys.argv[1], sys.argv[2])
>>
>>   File "web/copyright_updater.py", line 47, in findReplace
>>
>>     content = fp.read()
>>
>>   File "/Users/dpage/.virtualenvs/pgadmin4/bin/../lib/python3.6/codecs.py", line 321, in decode
>>
>>     (result, consumed) = self._buffer_decode(data, self.errors, final)
>>
>> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa3 in position 164: invalid start byte
>>
>>
>> :-(
>>
>> --
>> 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