changed to a directory oriented command line
prepare for side-by-side directory compare (like wdrm)
This commit is contained in:
@@ -13,14 +13,15 @@ these comments stick to the symlink
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
COMMENT_KEY = "user.xdg.comment"
|
|
||||||
DATABASE_NAME = "~/.dirnotes.db"
|
|
||||||
|
|
||||||
import sys,os,argparse
|
import sys,os,argparse
|
||||||
from PyQt4.QtGui import *
|
from PyQt4.QtGui import *
|
||||||
from PyQt4 import QtGui, QtCore
|
from PyQt4 import QtGui, QtCore
|
||||||
import xattr, sqlite3, time
|
import xattr, sqlite3, time
|
||||||
|
|
||||||
|
VERSION = "0.2"
|
||||||
|
COMMENT_KEY = "user.xdg.comment"
|
||||||
|
DATABASE_NAME = "~/.dirnotes.db"
|
||||||
|
# convert the ~/ form to a fully qualified path
|
||||||
DATABASE_NAME = os.path.expanduser(DATABASE_NAME)
|
DATABASE_NAME = os.path.expanduser(DATABASE_NAME)
|
||||||
|
|
||||||
class DataBase:
|
class DataBase:
|
||||||
@@ -61,11 +62,15 @@ class DataBase:
|
|||||||
|
|
||||||
def parse():
|
def parse():
|
||||||
parser = argparse.ArgumentParser(description='dirnotes application')
|
parser = argparse.ArgumentParser(description='dirnotes application')
|
||||||
parser.add_argument('filename',metavar='filename',type=str,
|
parser.add_argument('dirname',metavar='dirname',type=str,
|
||||||
nargs="*",help='filename or directory',default=".")
|
help='directory [default=current dir]',default=".",nargs='?')
|
||||||
|
parser.add_argument('dirname2',help='comparison directory, shows two-dirs side-by-side',nargs='?')
|
||||||
parser.add_argument('-n','--nogui',action="store_const",const="1",
|
parser.add_argument('-n','--nogui',action="store_const",const="1",
|
||||||
help='use text base interface')
|
help='use text base interface')
|
||||||
parser.add_argument('-v','--version',action='version',version='%(prog)s 0.2')
|
parser.add_argument('-v','--version',action='version',version='%(prog)s '+VERSION)
|
||||||
|
group = parser.add_mutually_exclusive_group()
|
||||||
|
group.add_argument('-s','--sort-by-name',metavar='sort',action="store_const",const='n')
|
||||||
|
group.add_argument('-m','--sort-by-date',metavar='sort',action='store_const',const='d')
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
def debug(x):
|
def debug(x):
|
||||||
@@ -157,7 +162,7 @@ if __name__=="__main__":
|
|||||||
print(time.strftime("%Y-%m-%d %H:%M:%S",time.localtime(d)))
|
print(time.strftime("%Y-%m-%d %H:%M:%S",time.localtime(d)))
|
||||||
|
|
||||||
a = QApplication([])
|
a = QApplication([])
|
||||||
dn = DirNotes(p.filename[0])
|
dn = DirNotes(p.dirname[0])
|
||||||
dn.show()
|
dn.show()
|
||||||
|
|
||||||
a.exec_()
|
a.exec_()
|
||||||
|
|||||||
Reference in New Issue
Block a user