Skip to content

Instantly share code, notes, and snippets.

@baseplate-admin
Last active January 5, 2022 17:26
Show Gist options
  • Save baseplate-admin/cfd4d76f91c39ed74aeebadef6e0325d to your computer and use it in GitHub Desktop.
Save baseplate-admin/cfd4d76f91c39ed74aeebadef6e0325d to your computer and use it in GitHub Desktop.

Revisions

  1. baseplate-admin revised this gist Jan 5, 2022. 1 changed file with 0 additions and 5 deletions.
    5 changes: 0 additions & 5 deletions bangla.py
    Original file line number Diff line number Diff line change
    @@ -5,11 +5,6 @@
    from io import BytesIO # Python 3
    import zipfile,base64,os,shutil

    from pathlib import Path

    os.chdir(os.path.join(Path.home(), "Downloads"))


    FONT_FILE = f'{os.getcwd()}/Kohinoor Bangla/'
    USER_SHARE_FONT = '/usr/share/fonts/'

  2. baseplate-admin revised this gist Jan 5, 2022. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions bangla.py
    Original file line number Diff line number Diff line change
    @@ -6,9 +6,8 @@
    import zipfile,base64,os,shutil

    from pathlib import Path
    downloads_path = str(Path.home() / "Downloads")

    os.chdir(downloads_path)
    os.chdir(os.path.join(Path.home(), "Downloads"))


    FONT_FILE = f'{os.getcwd()}/Kohinoor Bangla/'
  3. baseplate-admin revised this gist Jan 5, 2022. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions bangla.py
    Original file line number Diff line number Diff line change
    @@ -5,6 +5,12 @@
    from io import BytesIO # Python 3
    import zipfile,base64,os,shutil

    from pathlib import Path
    downloads_path = str(Path.home() / "Downloads")

    os.chdir(downloads_path)


    FONT_FILE = f'{os.getcwd()}/Kohinoor Bangla/'
    USER_SHARE_FONT = '/usr/share/fonts/'

  4. baseplate-admin revised this gist Jan 5, 2022. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion bangla.py
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,7 @@
    pass

    try:
    shutil.rmtree(f'{USER_SHARE_FONT}/Kohinoor Bangla/')
    shutil.rmtree('/usr/share/fonts/Kohinoor Bangla')

    except:
    pass
    @@ -27,3 +27,4 @@
    zipfile_ob.extractall(os.getcwd())

    shutil.move(FONT_FILE,USER_SHARE_FONT)

  5. baseplate-admin revised this gist Jan 5, 2022. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion bangla.py
    Original file line number Diff line number Diff line change
    @@ -10,12 +10,17 @@

    try:
    shutil.rmtree(FONT_FILE)
    shutil.rmtree(f'{USER_SHARE_FONT}/Kohinoor Bangla/')

    except:
    pass

    try:
    shutil.rmtree(f'{USER_SHARE_FONT}/Kohinoor Bangla/')

    except:
    pass


    in_memory_object = BytesIO(base64.b64decode(BASE64_FONT_ZIP))

    zipfile_ob = zipfile.ZipFile(in_memory_object)
  6. baseplate-admin created this gist Jan 5, 2022.
    24 changes: 24 additions & 0 deletions bangla.py
    24 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.