<commit_before>#!/usr/bin/env python3

VERSION = "2.0.0-pre2"

import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib, GObject, Pango, Gio
from threading import Thread
from threading import Timer
import urllib.request as ur
import sys
import os.path
import copy
import requests
import json
import time
from html.parser import HTMLParser
from bs4 import BeautifulSoup as Soup

GLib.threads_init()

home = os.path.expanduser("~") + "/"
config = home + ".local/share/python-utils/"

# CONFIGURATION
if not os.path.exists(config):
  os.makedirs(config, exist_ok=True)

if not os.path.exists(config + "ffgs-chat.cfg"):
  # TODO: create the file automatically [#10]
  pass

if not os.path.exists(config + "icons/"):
  os.mkdir(config + "icons/")

if not os.path.exists(config + "icons/ffgs-chat-icon.png"):
  response = ur.urlopen("https://raw.githubusercontent.com/Fingercomp/" \
    "python-utils/master/icons/ffgs-chat-icon.png")
  f = open(config + "icons/ffgs-chat-icon.png", "wb")
  img = response.read()
  f.write(img)
  f.close()

userdata = [i.strip() for i in open(
              os.path.expanduser("~") + \
              "/.config/ffgs-chat.cfg").readlines()]

DELAY = 10
URLGET = "http://ffgs.ru/chat/getmsg?id=1"
URLSEND = "http://ffgs.ru/chat/say"
URLONLINE = "http://ffgs.ru/chat/getonline"
URLUSER = "http://ffgs.ru/chat/getuser"<commit_msg>Fixed exist_ok issue on Python2.7<commit_after>#!/usr/bin/env python3

VERSION = "2.0.0-pre2"

import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib, GObject, Pango, Gio
from threading import Thread
from threading import Timer
import urllib.request as ur
import sys
import os.path
import copy
import requests
import json
import time
from html.parser import HTMLParser
from bs4 import BeautifulSoup as Soup

GLib.threads_init()

home = os.path.expanduser("~") + "/"
config = home + ".local/share/python-utils/"

# CONFIGURATION
if not os.path.exists(config):
  os.makedirs(config)

if not os.path.exists(config + "ffgs-chat.cfg"):
  # TODO: create the file automatically [#10]
  pass

if not os.path.exists(config + "icons/"):
  os.mkdir(config + "icons/")

if not os.path.exists(config + "icons/ffgs-chat-icon.png"):
  response = ur.urlopen("https://raw.githubusercontent.com/Fingercomp/" \
    "python-utils/master/icons/ffgs-chat-icon.png")
  f = open(config + "icons/ffgs-chat-icon.png", "wb")
  img = response.read()
  f.write(img)
  f.close()

userdata = [i.strip() for i in open(
              os.path.expanduser("~") + \
              "/.config/ffgs-chat.cfg").readlines()]

DELAY = 10
URLGET = "http://ffgs.ru/chat/getmsg?id=1"
URLSEND = "http://ffgs.ru/chat/say"
URLONLINE = "http://ffgs.ru/chat/getonline"
URLUSER = "http://ffgs.ru/chat/getuser"
{'fraction_non_alphanumeric': 0.16021699819168173, 'fraction_numerical': 0.010126582278481013, 'mean_word_length': 3.7607573149741826, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3981076', 'n_tokens_mistral': 1028, 'n_tokens_neox': 1015, 'n_words': 228}