Optimize imports

This commit is contained in:
enkore 2013-10-31 22:33:18 +01:00
parent 6a749bb03a
commit c43a22c46d
10 changed files with 10 additions and 20 deletions

View File

@ -8,6 +8,13 @@ from i3pystatus.core.util import formatp
__path__ = extend_path(__path__, __name__) __path__ = extend_path(__path__, __name__)
__all__ = [
"Status",
"Module", "IntervalModule",
"SettingsBase",
"formatp",
]
def main(): def main():
from i3pystatus.clock import Clock from i3pystatus.clock import Clock

View File

@ -2,7 +2,6 @@
import time import time
import json import json
import sys import sys
import threading
from contextlib import contextmanager from contextlib import contextmanager

View File

@ -1,14 +1,10 @@
import collections import collections
import functools import functools
import itertools
import re import re
import socket import socket
import string import string
from i3pystatus.core.exceptions import *
from i3pystatus.core.imputil import ClassFinder
def lchop(string, prefix): def lchop(string, prefix):
"""Removes a prefix from string """Removes a prefix from string

View File

@ -2,8 +2,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import sys import sys
import json
from datetime import datetime, timedelta
import imaplib import imaplib
from i3pystatus.mail import Backend from i3pystatus.mail import Backend
@ -45,7 +43,7 @@ class IMAP(Backend):
try: try:
self.connection.select(self.mailbox) self.connection.select(self.mailbox)
except Exception as e: except Exception:
self.connection = None self.connection = None
return self.connection return self.connection

View File

@ -4,7 +4,6 @@
# note that this needs the notmuch python bindings. For more info see: # note that this needs the notmuch python bindings. For more info see:
# http://notmuchmail.org/howto/#index4h2 # http://notmuchmail.org/howto/#index4h2
import notmuch import notmuch
import json
from i3pystatus.mail import Backend from i3pystatus.mail import Backend

View File

@ -7,9 +7,6 @@
# The plugin must be active and thunderbird running for the module to work # The plugin must be active and thunderbird running for the module to work
# properly. # properly.
import json
import threading
import time
from functools import partial from functools import partial
import dbus import dbus

View File

@ -1,7 +1,7 @@
from i3pystatus import IntervalModule from i3pystatus import IntervalModule
from psutil import virtual_memory from psutil import virtual_memory
MEGABYTE = 1024**2 MEGABYTE = 1024 * 1024
class Mem(IntervalModule): class Mem(IntervalModule):

View File

@ -1,9 +1,6 @@
#!/usr/bin/env python #!/usr/bin/env python
import sys
import io
import pkgutil import pkgutil
from collections import namedtuple
import textwrap import textwrap
import i3pystatus import i3pystatus

View File

@ -1,9 +1,5 @@
#!/usr/bin/env python #!/usr/bin/env python
import sys
import json
import time
import threading
import urllib.request import urllib.request
import urllib.parse import urllib.parse
import urllib.error import urllib.error

View File

@ -2,6 +2,7 @@ from .pulse import *
from i3pystatus import Module from i3pystatus import Module
class PulseAudio(Module): class PulseAudio(Module):
""" """