List user theme files.
344468
def list_themes_user():
    """"""
    themes = [*os.scandir(os.path.join(CONF_DIR, "colorschemes/dark/")),
              *os.scandir(os.path.join(CONF_DIR, "colorschemes/light/"))]
    return [t for t in themes if os.path.isfile(t.path)]
1056288
def _theme_and_template_fp(self):
        """"""
        ptheme = self._config['theme'][0]
        if ptheme == "":
            ptheme = self.site.site_config['default_theme']
        pthemedir = os.path.join(self.site.dirs['themes'], ptheme)
        ptemplate = self._config['template'][0]
        if ptemplate == "":
            ptemplate = self.site.site_config['default_template']
        ptemplatefname = os.path.join(pthemedir, ptemplate)
        return (pthemedir, ptemplatefname)
759543
public function getFilesInTheme()
    {
        $dh = Loader::helper('file');
        $templateList = PageTemplate::getList();
        $pts = [];
        foreach ($templateList as $pt) {
            $pts[] = $pt->getPageTemplateHandle();
        }
        $files = [];
        $filesTmp = $dh->getDirectoryContents($this->pThemeDirectory);
        foreach ($filesTmp as $f) {
            if (strrchr($f, '.') == static::THEME_EXTENSION) {
                $fHandle = substr($f, 0, strpos($f, '.'));

                if ($f == FILENAME_THEMES_VIEW) {
                    $type = PageThemeFile::TFTYPE_VIEW;
                } elseif ($f == FILENAME_THEMES_CLASS) {
                    $type = PageThemeFile::TFTYPE_PAGE_CLASS;
                } else {
                    if ($f == FILENAME_THEMES_DEFAULT) {
                        $type = PageThemeFile::TFTYPE_DEFAULT;
                    } else {
                        if (in_array($f, SinglePage::getThemeableCorePages())) {
                            $type = PageThemeFile::TFTYPE_SINGLE_PAGE;
                        } else {
                            if (in_array($fHandle, $pts)) {
                                $type = PageThemeFile::TFTYPE_PAGE_TEMPLATE_EXISTING;
                            } else {
                                $type = PageThemeFile::TFTYPE_PAGE_TEMPLATE_NEW;
                            }
                        }
                    }
                }

                $pf = new PageThemeFile();
                $pf->setFilename($f);
                $pf->setType($type);
                $files[] = $pf;
            }
        }

        return $files;
    }
942241
def files_view(request):
    """"""

    hosts = Host.objects.visible_to_user(request.user)

    context = {"hosts": hosts}
    return render(request, "files/home.html", context)
68806
def user_list(self, userid, cur_p=''):
        '''
        
        '''
        current_page_number = int(cur_p) if cur_p else 1
        current_page_number = 1 if current_page_number < 1 else current_page_number

        kwd = {
            'current_page': current_page_number
        }

        recs = MEntity2User.get_all_pager_by_username(userid, current_page_num=current_page_number).objects()

        self.render('misc/entity/entity_user_download.html',
                    imgs=recs,
                    cfg=config.CMS_CFG,
                    kwd=kwd,
                    userinfo=self.userinfo)
795087
def add_user_css(self, css_list):
        
        if isinstance(css_list, string_types):
            css_list = [css_list]

        for css_path in css_list:
            if css_path and css_path not in self.user_css:
                if not os.path.exists(css_path):
                    raise IOError('%s user css file not found' % (css_path,))
                with codecs.open(css_path, encoding=self.encoding) as css_file:
                    self.user_css.append({
                        'path_url': utils.get_path_url(css_path,
                                                       self.relative),
                        'contents': css_file.read(),
                    })
1272643
def construct_user_list(raw_users=None):
        """"""
        users = Users(oktypes=User)
        for user_dict in raw_users:
            public_keys = None
            if user_dict.get('public_keys'):
                public_keys = [PublicKey(b64encoded=x, raw=None)
                               for x in user_dict.get('public_keys')]
            users.append(User(name=user_dict.get('name'),
                              passwd=user_dict.get('passwd'),
                              uid=user_dict.get('uid'),
                              gid=user_dict.get('gid'),
                              home_dir=user_dict.get('home_dir'),
                              gecos=user_dict.get('gecos'),
                              shell=user_dict.get('shell'),
                              public_keys=public_keys,
                              sudoers_entry=user_dict.get('sudoers_entry')))
        return users
1014403
def list_theme():
    """"""
    from engineer.themes import ThemeManager

    themes = ThemeManager.themes()
    col1, col2 = map(max, zip(*[(len(t.id) + 2, len(t.root_path) + 2) for t in themes.itervalues()]))

    themes = ThemeManager.themes_by_finder()
    for finder in sorted(themes.iterkeys()):
        if len(themes[finder]) > 0:
            puts("%s: " % finder)
            for theme in sorted(themes[finder], key=lambda _: _.id):
                with indent(4):
                    puts(
                        columns(
                            [colored.cyan("%s:" % theme.id), col1],
                            [colored.white(theme.root_path, bold=True), col2]
                        )
                    )
54408
static function ListFiles($list_file, &$list, &$css_file_name ){

		$list = explode("\n",file_get_contents($list_file));

		//pop the cached name that should match $compiled_name
		$css_file_name = array_pop($list);

		if( !preg_match('/^' . Less_Cache::$prefix . '[a-f0-9]+\.css$/',$css_file_name) ){
			$list[] = $css_file_name;
			$css_file_name = false;
		}

	}
763012
def describe_users(self, users_filter=None):
        """"""
        user_list = Users(oktypes=User)
        for user in self._user_list:
            if users_filter and (users_filter.get('name') == user.name or users_filter.get('uid') == user.uid):
                user_list.append(user)
        return user_list
441760
public function getAvailableThemePaths()
    {
        $paths      = [];
        $themePaths = $this->getThemePaths();

        foreach ($themePaths as $path) {
            $this->files->isDirectory(base_path($path)) && $paths[] = base_path($path);
        }

        return $paths;
    }
541737
def _list_files(self, path):
        """"""
        files = []
        for f in glob.glob(pathname=path):
            files.append(f)
        files.sort()
        return files
557580
public function listAction()
    {
        $automaticTheme = $this->addAutomaticTheme();

        $themeMaper = $this->getAdminThemeService();

        $themesActivated = $themeMaper->findActiveTheme();
        $themesNotActivated = $themeMaper->findActiveTheme(false);

        return array('themesActivated'    => $themesActivated,
                     'themesNotActivated' => $themesNotActivated,
                     'automaticTheme'     => $automaticTheme,
                     'flashMessages'      => $this->flashMessenger()->getMessages());
    }
1194892
def list_users(verbose=True, hashes=False):
    '''
    
    '''
    users = {} if verbose else []

    if verbose:
        # parse detailed user data
        res = __salt__['cmd.run_all'](
            'pdbedit --list --verbose {hashes}'.format(hashes="--smbpasswd-style" if hashes else ""),
        )

        if res['retcode'] > 0:
            log.error(res['stderr'] if 'stderr' in res else res['stdout'])
            return users

        user_data = {}
        for user in res['stdout'].splitlines():
            if user.startswith('-'):
                if 'unix username' in user_data:
                    users[user_data['unix username']] = user_data
                user_data = {}
            elif ':' in user:
                label = user[:user.index(':')].strip().lower()
                data = user[(user.index(':')+1):].strip()
                user_data[label] = data

        if user_data:
            users[user_data['unix username']] = user_data
    else:
        # list users
        res = __salt__['cmd.run_all']('pdbedit --list')

        if res['retcode'] > 0:
            return {'Error': res['stderr'] if 'stderr' in res else res['stdout']}

        for user in res['stdout'].splitlines():
            if ':' not in user:
                continue
            user_data = user.split(':')
            if len(user_data) >= 3:
                users.append(user_data[0])

    return users
115514
def mainloop(self):
        
        themes_dir = os.path.join(self.config_dir, 'color-schemes')
        selected_file = os.path.join(themes_dir, '.selected')
        current_file = os.path.join(themes_dir, '.current')

        # Read persisted state
        selected_themes = []
        if os.path.exists(selected_file):
            with open(selected_file, 'rt') as handle:
                selected_themes = [x.strip() for x in handle]

        current_theme = None
        if os.path.exists(current_file):
            with open(current_file, 'rt') as handle:
                current_theme = handle.readline().strip()

        # Scan config for available themes
        themes = {}
        for ext in ('.rc.default', '.rc'):
            for filepath in glob.glob(themes_dir + '/*' + ext):
                name = os.path.basename(filepath).split('.')[0]
                if name:
                    # This prefers '.rc.default' files, because those are checked first
                    themes.setdefault(name, filepath)

        # Use available selected themes in given order, if there are any, else all themes
        if selected_themes and not set(selected_themes).isdisjoint(set(themes)):
            theme_list = [x for x in selected_themes if x in themes]
        else:
            theme_list = list(sorted(themes))

        # Check options
        if self.options.list or self.options.all or self.options.toggle:
            if self.options.all:
                if os.path.exists(selected_file):
                    os.remove(selected_file)
                selected_themes = []

            for name in (self.options.toggle or '').replace(',', ' ').split():
                if name not in themes:
                    self.parser.error("Unknown theme {0!r}, use '--list' to show them".format(name))
                elif name in selected_themes:
                    selected_themes = [x for x in selected_themes if x != name]
                else:
                    selected_themes.append(name)

                with open(selected_file, 'wt') as handle:
                    handle.write('\n'.join(selected_themes + ['']))

            if self.options.list:
                for name in sorted(themes):
                    print("{} {} {}".format(
                        '*' if name == current_theme else ' ',
                        '{:2d}'.format(selected_themes.index(name) + 1)
                            if name in selected_themes else '  ',
                        name,
                    ))

        elif self.options.current or self.options.next:
            # Determine current theme, or rotate to next one
            new_theme = theme_list[0]
            if self.options.current and current_theme in theme_list:
                new_theme = current_theme
            elif current_theme in theme_list:
                new_theme = (theme_list * 2)[theme_list.index(current_theme) + 1]

            # Persist new theme
            if new_theme != current_theme:
                with open(current_file, 'wt') as handle:
                    handle.write(new_theme + '\n')

            # Return result
            sys.stdout.write(themes[new_theme])
            sys.stdout.flush()

        else:
            self.LOG.info("Current color theme is '{}'.".format(
                current_theme if current_theme in theme_list else theme_list[0]))
            self.LOG.info("Use '--help' to get usage information.")
272837
def ls(system, user, local, include_missing):
    """"""

    # default action is to list *all* auto-detected files
    if not (system or user or local):
        system = user = local = True

    for path in get_configfile_paths(system=system, user=user, local=local,
                                     only_existing=not include_missing):
        click.echo(path)
456100
def listall(self):
		'''
		
		'''
		file_name = []
		r = requests.get(
			'%s/users/%s/gists' % (BASE_URL, self.user),
			headers=self.gist.header
			)
		r_text = json.loads(r.text)
		limit = len(r.json())
		if (r.status_code == 200 ):
			for g,no in zip(r_text, range(0,limit)):
				for key,value in r.json()[no]['files'].iteritems():
					file_name.append(value['filename'])
			return file_name

		raise Exception('Username not found')