diff --git a/.gitignore b/.gitignore index 6929e55..328735c 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,8 @@ configstore/ *.log errlog -pyvenv/ \ No newline at end of file +pyvenv/ +user-password.py +apicache/ +*.lwp +*/throttle.ctrl diff --git a/python/afc_dailycat.py b/python/afc_dailycat.py index e9471f9..c282438 100644 --- a/python/afc_dailycat.py +++ b/python/afc_dailycat.py @@ -9,18 +9,6 @@ 'summary': 'สร้างหมวดหมู่ฉบับร่างสำหรับ [[WP:AfC]]', } -# if no .env file, skip -if not os.path.exists('.env'): - print('No .env file found, skipping') - exit() -else: - with open('.env', 'r') as fh: - vars_dict = dict( - tuple(line.replace('\n', '').split('=')) - for line in fh.readlines() if not line.startswith('#') - ) - os.environ.update(vars_dict) - site = Site('th', 'wikipedia') _month_name = { @@ -52,7 +40,7 @@ def main(): def create_new_page(date_str): pagename = opt['category'].format(date=date_str) - print("Creating page: " + pagename) + pywikibot.output('Creating page: ' + pagename) page = pywikibot.Page(site, pagename) if page.exists(): print('Page already exists') @@ -61,5 +49,4 @@ def create_new_page(date_str): page.save(summary=opt['summary']) -if __name__ == '__main__': - main() +main() diff --git a/python/user-config.py b/python/user-config.py deleted file mode 100644 index 5eb2d85..0000000 --- a/python/user-config.py +++ /dev/null @@ -1,2 +0,0 @@ -usernames = {} -usernames['wikipedia']['th'] = 'PatsaBot' \ No newline at end of file