Nekmo / telegram-upload

@@ -85,7 +85,8 @@
Loading
85 85
86 86
class Client(TelegramClient):
87 87
    def __init__(self, config_file, proxy=None, **kwargs):
88 -
        config = json.load(open(config_file))
88 +
        with open(config_file) as f:
89 +
            config = json.load(f)
89 90
        proxy = proxy if proxy is not None else get_proxy_environment_variable()
90 91
        proxy = parse_proxy_string(proxy)
91 92
        if proxy and proxy[0] == 'mtproxy':

@@ -14,5 +14,6 @@
Loading
14 14
    click.echo('Go to https://my.telegram.org and create a App in API development tools')
15 15
    api_id = click.prompt('Please Enter api_id', type=int)
16 16
    api_hash = click.prompt('Now enter api_hash')
17 -
    json.dump({'api_id': api_id, 'api_hash': api_hash}, open(CONFIG_FILE, 'w'))
17 +
    with open(CONFIG_FILE, 'w') as f:
18 +
        json.dump({'api_id': api_id, 'api_hash': api_hash}, f)
18 19
    return CONFIG_FILE
Files Coverage
telegram_upload 87.50%
tests 100.00%
Project Totals (17 files) 92.31%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading