示例#1
0
    def setup_view(self):
        self.object_buttons = self.get_object_buttons()

        # Title
        self.bigtext = urwid.BigText('pyrasite ' + __version__, None)
        self.bigtext.set_font(urwid.Thin6x6Font())
        bt = urwid.Padding(self.bigtext, 'left', None)
        bt = urwid.AttrWrap(bt, 'bigtext')

        # Create the object outpu
        self.object_output = urwid.Text("", wrap='any')
        ca = urwid.AttrWrap(self.object_output, 'object_output')

        # Select the first object
        self.object_buttons[2].set_state(True)

        # ListBox
        obj_out = urwid.Pile([urwid.Divider(), ca])
        objects = urwid.Pile(self.object_buttons)
        l = [objects, obj_out]
        w = urwid.ListBox(urwid.SimpleListWalker(l))

        # Frame
        w = urwid.AttrWrap(w, 'body')
        w = urwid.Frame(header=bt, body=w)

        # Exit message
        exit = urwid.BigText(('exit', " Quit? "), urwid.Thin6x6Font())
        exit = urwid.Overlay(exit, w, 'center', None, 'middle', None)

        return w, exit
示例#2
0
 def test_overlay(self):
     self.wstest(
         urwid.Overlay(urwid.BigText("hello", urwid.Thin6x6Font()),
                       urwid.SolidFill(), 'center', None, 'middle', None))
     self.wstest(
         urwid.Overlay(urwid.Text("hello"), urwid.SolidFill(), 'center',
                       ('relative', 100), 'middle', None))
示例#3
0
    def __init__(self, parent, language=modulehelper.LanguageType.CHINESE):
        self.parent = parent
        self.screen = None
        self.name = 'Login'
        self.visible = True
        self.language = language
        self.user = "******"

        ##draw header_content
        # logo
        self.logo = urwid.AttrWrap(urwid.BigText('DASONE', urwid.Thin6x6Font()), 'red')
        self.logo_padded = urwid.Padding(self.logo, 'center', None)
        self.logo_pd_fd = urwid.Filler(self.logo_padded, 'bottom', 'pack')
        self.logo = urwid.BoxAdapter(self.logo_pd_fd, 8)
        # user with fixed name
        self.name_field = urwid.AttrWrap(urwid.Text(["USER:"******"SYSADMIN")]), 'red')

        # every time login in has a challenge for forgetting password in case
        self.challenge_generate = self.get_challenge()
        self.challenge_field = urwid.AttrWrap(urwid.Text(["CHALLENGE:".ljust(20),
                                                          ('editcp', self.challenge_generate)]), 'red')

        #create header_content
        self.header_content = [self.logo, blank, blank, self.name_field, self.challenge_field]

        ## draw_fields with default info
        self.fields = ['SYS_PASSWORD']
        self.defaults = \
            {
                "SYS_PASSWORD": {"label": "PASSWORD",
                               "tooltip": "if you forget password, contact with us and login using a challenge code",
                               "value": ""}
            }
示例#4
0
 def _setup_splash(self):
     logger.info("Creating splash window")
     self.splash_screen = uw.Overlay(
         top_w=uw.BigText(APPLICATION_NAME, uw.Thin6x6Font()),
         bottom_w=uw.SolidFill(),
         align="center",
         width=None,
         valign="middle",
         height=None,
     )
示例#5
0
    def setup_view(self):
        self.logger_box = urwid.SimpleListWalker([])

        self._state_overview = urwid.Text("Starting")
        # ListBox
        self.job_box = urwid.ListBox(urwid.SimpleListWalker([]))

        w = urwid.Pile([urwid.AttrWrap(self.job_box, 'body')])

        # Frame
        hdr = urwid.Text(
            "Sisyphus | CWD: %s | Call: %s | Press h for help | press q or esc to quit"
            % (os.path.abspath('.'), ' '.join(sys.argv)),
            wrap='clip')
        self.header = hdr = urwid.AttrWrap(hdr, 'header')
        hdr = urwid.Pile([
            hdr,
            (10, urwid.AttrWrap(urwid.ListBox(self.logger_box), 'body')),
            urwid.AttrWrap(self._state_overview, 'note'),
        ])

        self.setup_menu_view()
        self.main_view = self.menu_view
        self.job_view = urwid.Frame(header=hdr, body=w)

        # Exit message
        exit = urwid.BigText(('exit', " Quit? "), font=urwid.Thin6x6Font())
        self.exit_view = urwid.Overlay(exit, w, 'center', None, 'middle', None)

        self.question_text = urwid.Text("  ")
        self.question_queue = Queue()
        self.question_sem = Semaphore()
        self.question_view = urwid.Overlay(self.question_text, self.main_view,
                                           'center', ('relative', 80),
                                           'middle', None)

        help = urwid.Text(help_text)
        self.help_view = urwid.Frame(header=self.header,
                                     body=urwid.ListBox([help]))

        self.setup_object_view()

        self.history = []
        self.stop_job_view_update = False
        self.current_jobs = []
示例#6
0
    def setup_view(self):

        # File list
        fnamews = []
        newnamews = []
        tracks = albumtag.namebinder_trackorder(self.filelist, self.album,
                                                self.encoding)
        for i, (fpath, track) in enumerate(zip(self.filelist, tracks)):
            fname = fpath.getName()
            fbox = urwid.Text(fname)
            fbox = urwid.AttrWrap(fbox, 'filename normal', 'filename select')
            fnamews.append(fbox)
            newname = policy.genfilename(fpath, self.album, track)
            fbox = ListItem(newname, on_press=self.switchSelect)
            fbox.idx = i
            fbox = urwid.AttrWrap(fbox, 'filename normal', 'filename select')
            newnamews.append(fbox)

        # Left ListBox
        fnames = urwid.Pile(fnamews, focus_item=0)
        fnamesSlw = urwid.SimpleListWalker([fnames])
        lstfnames = border(urwid.ListBox(fnamesSlw))

        # XXX: synchronized scrolling, or better yet, one listbox

        # Right ListBox
        newnames = MovePile(newnamews, focus_item=0)
        self.newNamesList = newnames
        newnamesSlw = urwid.SimpleListWalker([newnames])
        mvl = urwid.ListBox(newnamesSlw)
        lstnewnames = border(mvl)

        col = urwid.Columns([lstfnames, lstnewnames], 1, focus_column=1)

        # Frame
        w = urwid.AttrWrap(col, 'body')
        hdr = urwid.Text("Line up the files with their new names")
        hdr = urwid.AttrWrap(hdr, 'header')
        w = urwid.Frame(header=hdr, body=w)

        # Exit message
        exit = urwid.BigText(('exit', " Quit? "), urwid.Thin6x6Font())
        exit = urwid.Overlay(exit, w, 'center', None, 'middle', None)
        return w, exit
from aircrack.aireplay import Aireplay
from aircrack.airmon import Airmon
from aircrack.airodump import Airodump
from aircrack.cowpatty import Cowpatty
from aircrack.models import WifiAdapter, AccessPoint, Station

from urwid_components import SimpleButton, OkDialog, StyledButton, Dialog

PALETTE = [
    ('banner', 'dark red', ''),
    ('reversed', 'standout', ''),
]

LOGO = urwid.Pile([
    urwid.Padding(
        urwid.BigText(('banner', "WiFi Snitch"), urwid.Thin6x6Font()),
        width="clip",
        align=urwid.CENTER,
    ),
    urwid.Divider(),
])
BACKGROUND = urwid.AttrMap(urwid.SolidFill('.'), 'bg')


class MainOverlay(urwid.Overlay):
    def __init__(self, widget: urwid.Widget):
        super().__init__(
            widget,
            BACKGROUND,
            align=urwid.CENTER,
            valign=urwid.MIDDLE,
示例#8
0
tab x tab x ta  x tb  x ab  xtab  xtab3 xta 3 xtb 3 xab   xab3  xab  x ta x 3
tab y tab y tab y tab y tab y tab y tab y tab y tab y tab y tab y taby3 tay 3
tab z tab z tab z tab z tab z tab z tab z tab z tab z tab z tab z tabz3 taz 3
tab 1 tab 1 tab 1 tab 1 tab 1 tab 1 tab 1 tab 1 tab 1 tab 1 tab 1 tab13 ta1 3
tab 2 tab 2 tab 2 tab 2 tab 2 tab 2 tab 2 tab 2 tab 2 tab 2 tab 2 tab23 ta2 3
tab 2 tab 2 tab 2 tab 2 tab 2 tab 2 tab 2 tab 2 tab 2 tab 2 tab 2tab 2 tab 2
tab 3 tab 3 tab 3 tab 3 tab 3 tab 3 tab 3 tab 3 tab 3 tab 3 tab 3 tab3  tab3
tab 4 tab 4 tab 4 tab 4 tab 4 tab 4 tab 4 tab 4 tab 4 tab 4 tab 4 tab4  tab4
tab 5 tab 5 tab 5 tab 5 tab 5 tab 5 tab 5 tab 5 tab 5 tab 5 tab 5 tab5  tab5
tab 6 tab 6 tab 6 tab 6 tab 6 tab 6 tab 6 tab 6 tab 6 tab 6 tab 6 tab6  tab6
tab 7 tab 7 tab 7 tab 7 tab 7 tab 7 tab 7 tab 7 tab 7 tab 7 tab 7 tab7  tab7
tab 8 tab 8 tab 8 tab 8 tab 8 tab 8 tab 8 tab 8 tab 8 tab 8 tab 8 tab8  tab8""" )

f1 = urwid.AttrWrap( urwid.Filler( urwid.AttrWrap( urwid.LineBox( txt1, "body" ), 'dif' ) ), 'body' )
f2 = scrollview.ScrollView(urwid.BigText("Hello World and welcome to my scroll view",
                                         urwid.Thin6x6Font( )), 'scroll')
f3 = scrollview.ScrollView(txt3, 'scroll')

tab_view = tabview.TabView(
        'header',
        'header1',
        [ (u'Hello World', f1, True), (u'Goodbyte', f2, True), (u'test.py', f3) ]
)

split1 = splitview.SplitView(
        f1,
        tab_view,
        False,
        0.4,
        'splitbar'
)