浏览代码

Add Xlib as a submodule

Taddeus Kroes 5 年之前
父节点
当前提交
4af667da5c
共有 4 个文件被更改,包括 12 次插入1 次删除
  1. 3 0
      .gitmodules
  2. 4 1
      bot.py
  3. 4 0
      interaction.py
  4. 1 0
      python-xlib

+ 3 - 0
.gitmodules

@@ -0,0 +1,3 @@
+[submodule "python-xlib"]
+	path = python-xlib
+	url = git@github.com:python-xlib/python-xlib.git

+ 4 - 1
bot.py

@@ -1,4 +1,8 @@
 #!/usr/bin/env python3
+import sys
+from os.path import dirname, join
+sys.path.insert(0, join(dirname(__file__), 'python-xlib'))
+
 import os
 import time
 from collections import deque
@@ -25,7 +29,6 @@ def save_screenshot(win):
 
 
 if __name__ == '__main__':
-    import sys
     verbose = '-q' not in sys.argv[1:]
 
     try:

+ 4 - 0
interaction.py

@@ -1,3 +1,7 @@
+import sys
+from os.path import dirname, join
+sys.path.insert(0, join(dirname(__file__), 'python-xlib'))
+
 import time
 from random import randint
 from Xlib import display, X, XK, ext

+ 1 - 0
python-xlib

@@ -0,0 +1 @@
+Subproject commit 2dbeb64e10169b485af1292fb649287a28a07864