src/eric7/UI/UserInterface.py

branch
eric7
changeset 10301
b4299b82fe37
parent 10278
e26fa3b06f4f
child 10303
ee1aadab1215
equal deleted inserted replaced
10300:60e8f2175b3b 10301:b4299b82fe37
1631 self.__openOnStartup() 1631 self.__openOnStartup()
1632 return 1632 return
1633 1633
1634 opens = 0 1634 opens = 0
1635 1635
1636 # holds space delimited list of command args, if any 1636 if "--" in args:
1637 argsStr = None 1637 # store args after a '--' as a space delimited list of command args, if any
1638 # flag indicating '--' options was found 1638 ddindex = args.index("--")
1639 ddseen = False 1639 argsStr = " ".join(args[ddindex + 1:])
1640 1640 args = args[:ddindex]
1641 argChars = ["-", "/"] if OSUtilities.isWindowsPlatform() else ["-"] 1641 else:
1642 argsStr = None
1642 1643
1643 for arg in args: 1644 for arg in args:
1644 # handle a request to start with last session 1645 # handle a request to start with last session
1645 if arg == "--start-file": 1646 if arg == "--start-file":
1646 self.__openOnStartup("File") 1647 self.__openOnStartup("File")
1657 elif arg == "--start-session": 1658 elif arg == "--start-session":
1658 self.__openOnStartup("Session") 1659 self.__openOnStartup("Session")
1659 # ignore all further arguments 1660 # ignore all further arguments
1660 return 1661 return
1661 1662
1662 if arg == "--" and not ddseen:
1663 ddseen = True
1664 continue
1665
1666 if arg[0] in argChars or ddseen:
1667 if argsStr is None:
1668 argsStr = arg
1669 else:
1670 argsStr = "{0} {1}".format(argsStr, arg)
1671 continue
1672
1673 try: 1663 try:
1674 ext = os.path.splitext(arg)[1] 1664 ext = os.path.normcase(os.path.splitext(arg)[1])
1675 ext = os.path.normcase(ext)
1676 except IndexError: 1665 except IndexError:
1677 ext = "" 1666 ext = ""
1678 1667
1679 if ext in (".epj", ".e4p"): 1668 if ext in (".epj", ".e4p"):
1680 self.project.openProject(arg) 1669 self.project.openProject(arg)

eric ide

mercurial