summaryrefslogtreecommitdiff
path: root/doxygen/xml/fileutil_8py.xml
blob: c9ab64cad8a0b35f7dcf7a805db132a5cf87da85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.7.5.1">
  <compounddef id="fileutil_8py" kind="file">
    <compoundname>fileutil.py</compoundname>
    <innernamespace refid="namespacefileutil">fileutil</innernamespace>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1" refid="namespacefileutil" refkind="compound"><highlight class="keyword">import</highlight><highlight class="normal"><sp/>glob</highlight></codeline>
<codeline lineno="2"><highlight class="normal"></highlight><highlight class="keyword">import</highlight><highlight class="normal"><sp/>os.path</highlight></codeline>
<codeline lineno="3"><highlight class="normal"></highlight></codeline>
<codeline lineno="4"><highlight class="normal"></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>fullfilename<sp/></highlight><highlight class="keywordflow">in</highlight><highlight class="normal"><sp/>glob.glob(</highlight><highlight class="stringliteral">&apos;/home/cat/proj/cmd2/*.py&apos;</highlight><highlight class="normal">):</highlight></codeline>
<codeline lineno="5"><highlight class="normal"><sp/><sp/><sp/><sp/>(dirpath,<sp/>fname)<sp/>=<sp/>os.path.split(fullfilename)</highlight></codeline>
<codeline lineno="6" refid="namespacefileutil_1a8eba55ef4caa4c8d11e8aa2e235b9158" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/>stats<sp/>=<sp/>os.stat(fullfilename)</highlight></codeline>
<codeline lineno="7"><highlight class="normal"><sp/><sp/><sp/><sp/>binds[</highlight><highlight class="stringliteral">&apos;path&apos;</highlight><highlight class="normal">]<sp/>=<sp/>dirpath</highlight></codeline>
<codeline lineno="8"><highlight class="normal"><sp/><sp/><sp/><sp/>binds[</highlight><highlight class="stringliteral">&apos;name&apos;</highlight><highlight class="normal">]<sp/>=<sp/>fname</highlight></codeline>
<codeline lineno="9"><highlight class="normal"><sp/><sp/><sp/><sp/>binds[</highlight><highlight class="stringliteral">&apos;bytes&apos;</highlight><highlight class="normal">]<sp/>=<sp/>stats.st_size</highlight></codeline>
<codeline lineno="10"><highlight class="normal"><sp/><sp/><sp/><sp/>cmd(</highlight><highlight class="stringliteral">&quot;&quot;&quot;INSERT<sp/>INTO<sp/>cat.files<sp/>(path,<sp/>name,<sp/>bytes)</highlight></codeline>
<codeline lineno="11"><highlight class="stringliteral"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>VALUES<sp/>(%(path)s,<sp/>%(name)s,<sp/>%(bytes)s)&quot;&quot;&quot;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="12"><highlight class="normal">quit()</highlight></codeline>
    </programlisting>
    <location file="/Users/amrogers/Developer/Projects/cmd2/docs/pycon2010/fileutil.py"/>
  </compounddef>
</doxygen>